enhance: analytic init and reactive style

This commit is contained in:
0xJacky 2023-02-13 11:09:17 +08:00
parent 38aa1d8bfc
commit d6b68b807f
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
3 changed files with 62 additions and 19 deletions

View file

@ -183,6 +183,8 @@ func GetAnalyticInit(c *gin.Context) {
}
hostInfo, _ := host.Info()
loadAvg, _ := load.Avg()
c.JSON(http.StatusOK, gin.H{
"host": hostInfo,
"cpu": gin.H{
@ -199,7 +201,8 @@ func GetAnalyticInit(c *gin.Context) {
"writes": analytic.DiskWriteRecord,
"reads": analytic.DiskReadRecord,
},
"memory": memory,
"disk": diskStat,
"memory": memory,
"disk": diskStat,
"loadavg": loadAvg,
})
}