You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
704 B

/**
* Created by GoLand.
* User: link1st
* Date: 2019-07-25
* Time: 12:11
*/
package systems
import (
"fmt"
"github.com/gin-gonic/gin"
"gowebsocket/common"
"gowebsocket/controllers"
"gowebsocket/servers/websocket"
"runtime"
)
// 查询系统状态
func Status(c *gin.Context) {
isDebug := c.Query("isDebug")
fmt.Println("http_request 查询系统状态", isDebug)
data := make(map[string]interface{})
numGoroutine := runtime.NumGoroutine()
numCPU := runtime.NumCPU()
// goroutine 的数量
data["numGoroutine"] = numGoroutine
data["numCPU"] = numCPU
// ClientManager 信息
data["managerInfo"] = websocket.GetManagerInfo(isDebug)
controllers.Response(c, common.OK, "", data)
}