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

Method statistics

module/monitor/iml.go:997–1014  ·  view source on GitHub ↗
(ctx context.Context, clusterId string, groupBy string, start, end time.Time, wheres []monitor.MonWhereItem, limit int)

Source from the content-addressed store, hash-verified

995}
996
997func (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
1016func (i *imlMonitorStatisticModule) TopAPIStatistics(ctx context.Context, limit int, input *monitor_dto.CommonInput) ([]*monitor_dto.ApiStatisticItem, error) {
1017 clusterId := cluster.DefaultClusterID

Callers 5

apiStatisticsMethod · 0.95
serviceStatisticsMethod · 0.95
statisticOnApiMethod · 0.95
TopAPIStatisticsMethod · 0.95
topProjectStatisticsMethod · 0.95

Calls 4

getExecutorMethod · 0.95
GetStatisticsCacheMethod · 0.65
CommonStatisticsMethod · 0.65
SetStatisticsCacheMethod · 0.65

Tested by

no test coverage detected