(ctx Context)
| 58 | } |
| 59 | |
| 60 | func 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 |
| 87 | func showServerState(ctx Context) error { |
no test coverage detected