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

Method AITopN

controller/monitor/iml.go:37–51  ·  view source on GitHub ↗
(ctx *gin.Context, start string, end string, limit string)

Source from the content-addressed store, hash-verified

35}
36
37func (i *imlMonitorStatisticController) AITopN(ctx *gin.Context, start string, end string, limit string) ([]*monitor_dto.TopN, []*monitor_dto.TopN, error) {
38 s, e, err := formatTime(start, end)
39 if err != nil {
40 return nil, nil, err
41 }
42 l, err := strconv.Atoi(limit)
43 if err != nil {
44 if limit == "" {
45 l = 10
46 } else {
47 return nil, nil, fmt.Errorf("parse limit %s error: %w", limit, err)
48 }
49 }
50 return i.module.Top(ctx, "", s, e, l, "ai")
51}
52
53func formatTime(start string, end string) (int64, int64, error) {
54 s, err := strconv.ParseInt(start, 10, 64)

Callers

nothing calls this directly

Calls 2

formatTimeFunction · 0.70
TopMethod · 0.65

Tested by

no test coverage detected