MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / summary

Method summary

module/monitor/driver/influxdb-v2/executor.go:257–278  ·  view source on GitHub ↗
(ctx context.Context, start, end time.Time, bucket string, filters string, filterCfg *flux.StatisticsFilterConf, prefix string)

Source from the content-addressed store, hash-verified

255}
256
257func (e *executor) summary(ctx context.Context, start, end time.Time, bucket string, filters string, filterCfg *flux.StatisticsFilterConf, prefix string) (*monitor.Summary, error) {
258 //获取请求表的饼状图
259 queryOnce, err := e.fluxQuery.CommonQueryOnce(ctx, e.openApi, start, end, bucket, filters, filterCfg)
260 if err != nil {
261 return nil, err
262 }
263 summary := new(monitor.Summary)
264 if v, ok := queryOnce[prefix+"s4xx"]; ok {
265 summary.Status4Xx = common.FmtIntFromInterface(v)
266 }
267 if v, ok := queryOnce[prefix+"s5xx"]; ok {
268 summary.Status5Xx = common.FmtIntFromInterface(v)
269 }
270 if v, ok := queryOnce[prefix+"success"]; ok {
271 summary.Success = common.FmtIntFromInterface(v)
272 }
273 if v, ok := queryOnce[prefix+"total"]; ok {
274 summary.Total = common.FmtIntFromInterface(v)
275 }
276 summary.Fail = summary.Total - summary.Success
277 return summary, nil
278}
279
280func (e *executor) RequestSummary(ctx context.Context, start time.Time, end time.Time, wheres []monitor.MonWhereItem) (*monitor.Summary, error) {
281 newStartTime, _, _, bucket := getTimeIntervalAndBucket(start, end)

Callers 2

RequestSummaryMethod · 0.95
ProxySummaryMethod · 0.95

Calls 2

FmtIntFromInterfaceFunction · 0.92
CommonQueryOnceMethod · 0.65

Tested by

no test coverage detected