MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / RestTopN

Method RestTopN

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

Source from the content-addressed store, hash-verified

63}
64
65func (i *imlMonitorStatisticController) RestTopN(ctx *gin.Context, start string, end string, limit string) ([]*monitor_dto.TopN, []*monitor_dto.TopN, error) {
66 s, e, err := formatTime(start, end)
67 if err != nil {
68 return nil, nil, err
69 }
70 l, err := strconv.Atoi(limit)
71 if err != nil {
72 if limit == "" {
73 l = 10
74 } else {
75 return nil, nil, fmt.Errorf("parse limit %s error: %w", limit, err)
76 }
77 }
78 return i.module.Top(ctx, "", s, e, l, "rest")
79}
80
81func (i *imlMonitorStatisticController) Statistics(ctx *gin.Context, dataType string, input *monitor_dto.StatisticInput) (interface{}, error) {
82 switch dataType {

Callers

nothing calls this directly

Calls 2

formatTimeFunction · 0.70
TopMethod · 0.65

Tested by

no test coverage detected