(id string, name string, item *monitor.TopN, apiKind string)
| 370 | } |
| 371 | |
| 372 | func generateTopN(id string, name string, item *monitor.TopN, apiKind string) *monitor_dto.TopN { |
| 373 | n := &monitor_dto.TopN{ |
| 374 | Id: id, |
| 375 | Name: name, |
| 376 | Request: common.FormatCountInt64(item.Request), |
| 377 | } |
| 378 | switch apiKind { |
| 379 | case "rest": |
| 380 | n.Traffic = common.FormatByte(item.Traffic) |
| 381 | case "ai": |
| 382 | n.Token = common.FormatCountInt64(item.Token) |
| 383 | } |
| 384 | return n |
| 385 | } |
| 386 | |
| 387 | func (i *imlMonitorStatisticModule) Top(ctx context.Context, serviceId string, start int64, end int64, limit int, apiKind string) ([]*monitor_dto.TopN, []*monitor_dto.TopN, error) { |
| 388 | wheres, err := i.genOverviewWhere(ctx, serviceId, []string{apiKind}) |
no test coverage detected