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

Method ApiStatisticsOnProvider

module/monitor/iml.go:868–890  ·  view source on GitHub ↗
(ctx context.Context, providerId string, input *monitor_dto.StatisticInput)

Source from the content-addressed store, hash-verified

866}
867
868func (i *imlMonitorStatisticModule) ApiStatisticsOnProvider(ctx context.Context, providerId string, input *monitor_dto.StatisticInput) ([]*monitor_dto.ApiStatisticBasicItem, error) {
869 clusterId := cluster.DefaultClusterID
870 _, err := i.clusterService.Get(ctx, clusterId)
871 if err != nil {
872 return nil, err
873 }
874
875 apiInfos, err := i.apiService.ListInfoForService(ctx, providerId)
876 if err != nil {
877 return nil, err
878 }
879 wheres, err := i.genCommonWheres(ctx, clusterId)
880 if err != nil {
881 return nil, err
882 }
883 wheres = append(wheres, monitor.MonWhereItem{
884 Key: "provider",
885 Operation: "=",
886 Values: []string{providerId},
887 })
888
889 return i.apiStatistics(ctx, clusterId, apiInfos, formatTimeByMinute(input.Start), formatTimeByMinute(input.End), wheres, 0)
890}
891
892func (i *imlMonitorStatisticModule) ApiStatisticsOnSubscriber(ctx context.Context, subscriberId string, input *monitor_dto.StatisticInput) ([]*monitor_dto.ApiStatisticBasicItem, error) {
893 clusterId := cluster.DefaultClusterID

Callers

nothing calls this directly

Calls 5

genCommonWheresMethod · 0.95
apiStatisticsMethod · 0.95
formatTimeByMinuteFunction · 0.70
GetMethod · 0.65
ListInfoForServiceMethod · 0.65

Tested by

no test coverage detected