MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / GetLogsStat

Function GetLogsStat

controller/log.go:101–122  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

99}
100
101func GetLogsStat(c *gin.Context) {
102 logType, _ := strconv.Atoi(c.Query("type"))
103 startTimestamp, _ := strconv.ParseInt(c.Query("start_timestamp"), 10, 64)
104 endTimestamp, _ := strconv.ParseInt(c.Query("end_timestamp"), 10, 64)
105 tokenName := c.Query("token_name")
106 username := c.Query("username")
107 modelName := c.Query("model_name")
108 channel, _ := strconv.Atoi(c.Query("channel"))
109 group := c.Query("group")
110 stat := model.SumUsedQuota(logType, startTimestamp, endTimestamp, modelName, username, tokenName, channel, group)
111 //tokenNum := model.SumUsedToken(logType, startTimestamp, endTimestamp, modelName, username, "")
112 c.JSON(http.StatusOK, gin.H{
113 "success": true,
114 "message": "",
115 "data": gin.H{
116 "quota": stat.Quota,
117 "rpm": stat.Rpm,
118 "tpm": stat.Tpm,
119 },
120 })
121 return
122}
123
124func GetLogsSelfStat(c *gin.Context) {
125 username := c.GetString("username")

Callers

nothing calls this directly

Calls 1

SumUsedQuotaFunction · 0.92

Tested by

no test coverage detected