chore: add goroutine num display
This commit is contained in:
@@ -2,6 +2,7 @@ package controllers
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"baihu/internal/constant"
|
"baihu/internal/constant"
|
||||||
@@ -184,6 +185,7 @@ func (sc *SettingsController) GetAbout(c *gin.Context) {
|
|||||||
"version": constant.Version,
|
"version": constant.Version,
|
||||||
"build_time": constant.BuildTime,
|
"build_time": constant.BuildTime,
|
||||||
"mem_usage": memUsage,
|
"mem_usage": memUsage,
|
||||||
|
"goroutines": runtime.NumGoroutine(),
|
||||||
"uptime": uptime,
|
"uptime": uptime,
|
||||||
"task_count": taskCount,
|
"task_count": taskCount,
|
||||||
"log_count": logCount,
|
"log_count": logCount,
|
||||||
|
|||||||
@@ -313,6 +313,7 @@ export interface AboutInfo {
|
|||||||
version: string
|
version: string
|
||||||
build_time: string
|
build_time: string
|
||||||
mem_usage: string
|
mem_usage: string
|
||||||
|
goroutines: number
|
||||||
uptime: string
|
uptime: string
|
||||||
task_count: number
|
task_count: number
|
||||||
log_count: number
|
log_count: number
|
||||||
|
|||||||
@@ -60,6 +60,10 @@ onMounted(loadAbout)
|
|||||||
<span class="text-muted-foreground text-sm">内存使用:</span>
|
<span class="text-muted-foreground text-sm">内存使用:</span>
|
||||||
<span class="text-sm">{{ aboutInfo?.mem_usage || '-' }}</span>
|
<span class="text-sm">{{ aboutInfo?.mem_usage || '-' }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex justify-between items-center">
|
||||||
|
<span class="text-muted-foreground text-sm">协程数量:</span>
|
||||||
|
<span class="text-sm">{{ aboutInfo?.goroutines || '-' }}</span>
|
||||||
|
</div>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<span class="text-muted-foreground text-sm">运行时间:</span>
|
<span class="text-muted-foreground text-sm">运行时间:</span>
|
||||||
<span class="text-sm">{{ aboutInfo?.uptime || '-' }}</span>
|
<span class="text-sm">{{ aboutInfo?.uptime || '-' }}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user