(ctx context.Context, clusterId string, groupBy string, start, end time.Time, wheres []monitor.MonWhereItem, limit int)
| 995 | } |
| 996 | |
| 997 | func (i *imlMonitorStatisticModule) statistics(ctx context.Context, clusterId string, groupBy string, start, end time.Time, wheres []monitor.MonWhereItem, limit int) (map[string]monitor.MonCommonData, error) { |
| 998 | statisticMap, _ := i.monitorStatisticCacheService.GetStatisticsCache(ctx, clusterId, start, end, groupBy, wheres, limit) |
| 999 | if len(statisticMap) > 0 { |
| 1000 | return statisticMap, nil |
| 1001 | } |
| 1002 | |
| 1003 | executor, err := i.getExecutor(ctx, clusterId) |
| 1004 | if err != nil { |
| 1005 | return nil, err |
| 1006 | } |
| 1007 | |
| 1008 | result, err := executor.CommonStatistics(ctx, start, end, groupBy, limit, wheres) |
| 1009 | if err != nil { |
| 1010 | return nil, err |
| 1011 | } |
| 1012 | i.monitorStatisticCacheService.SetStatisticsCache(ctx, clusterId, start, end, groupBy, wheres, limit, result) |
| 1013 | return result, nil |
| 1014 | } |
| 1015 | |
| 1016 | func (i *imlMonitorStatisticModule) TopAPIStatistics(ctx context.Context, limit int, input *monitor_dto.CommonInput) ([]*monitor_dto.ApiStatisticItem, error) { |
| 1017 | clusterId := cluster.DefaultClusterID |
no test coverage detected