Skip to content

Commit

Permalink
增加耗时数据
Browse files Browse the repository at this point in the history
  • Loading branch information
lvyahui8 committed Sep 28, 2024
1 parent b3a64f6 commit 69cc1d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func N(n int) int {
if n == 0 {
return 1
}
time.Sleep(10 * time.Millisecond)
return n * N(n-1)
}

Expand All @@ -107,6 +108,7 @@ func setupRouter() *gin.Engine {

// Ping test
r.GET("/ping", func(c *gin.Context) {
time.Sleep(101 * time.Millisecond)
c.String(http.StatusOK, "pong")
})

Expand Down
2 changes: 1 addition & 1 deletion viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>Ellyn</title>
</head>
<body>
<div id="root"></div>
Expand Down
6 changes: 3 additions & 3 deletions viewer/src/Graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ const Node = ({ data, size }) => {
return 'gray';
}
if (category === 'cost') {
if (value <= 10) return 'green';
if (value >= 30) return 'red';
return 'gray';
if (value <= 50) return 'green';
if (value >= 100) return 'red';
return 'lightgreen';
}
return 'orange';
};
Expand Down

0 comments on commit 69cc1d2

Please sign in to comment.