MCPcopy Create free account
hub / github.com/devfeel/dotweb / showIntervalDataPretty

Function showIntervalDataPretty

dotweb_sysgroup.go:60–84  ·  view source on GitHub ↗
(ctx Context)

Source from the content-addressed store, hash-verified

58}
59
60func showIntervalDataPretty(ctx Context) error {
61 type data struct {
62 Time string
63 RequestCount uint64
64 ErrorCount uint64
65 }
66 queryKey := ctx.QueryString("querykey")
67 d := new(data)
68 d.Time = queryKey
69 d.RequestCount = ctx.HttpServer().StateInfo().QueryIntervalRequestData(queryKey)
70 d.ErrorCount = ctx.HttpServer().StateInfo().QueryIntervalErrorData(queryKey)
71 tableData := "<tr><td>" + d.Time + "</td><td>" + fmt.Sprint(d.RequestCount) + "</td><td>" + fmt.Sprint(d.ErrorCount) + "</td></tr>"
72 col := `<colgroup>
73 <col width="40%">
74 <col width="30%">
75 <col width="30%">
76 </colgroup>`
77 header := `<tr>
78 <th>Time</th>
79 <th>RequestCount</th>
80 <th>ErrorCount</th>
81 </tr>`
82 html := core.CreateTableHtml(col, "IntervalData", header, tableData)
83 return ctx.WriteHtml(html)
84}
85
86// snow server status
87func showServerState(ctx Context) error {

Callers 1

showIntervalDataFunction · 0.85

Calls 7

CreateTableHtmlFunction · 0.92
QueryStringMethod · 0.65
HttpServerMethod · 0.65
WriteHtmlMethod · 0.65
StateInfoMethod · 0.45

Tested by

no test coverage detected