(ctx *gin.Context, start string, end string, limit string)
| 35 | } |
| 36 | |
| 37 | func (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 | |
| 53 | func formatTime(start string, end string) (int64, int64, error) { |
| 54 | s, err := strconv.ParseInt(start, 10, 64) |
nothing calls this directly
no test coverage detected