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

Method ProviderStatistics

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

Source from the content-addressed store, hash-verified

641}
642
643func (i *imlMonitorStatisticModule) ProviderStatistics(ctx context.Context, input *monitor_dto.StatisticInput) ([]*monitor_dto.ServiceStatisticBasicItem, error) {
644 clusterId := cluster.DefaultClusterID
645 _, err := i.clusterService.Get(ctx, clusterId)
646 if err != nil {
647 return nil, err
648 }
649
650 services, err := i.serviceService.ServiceList(ctx, input.Services...)
651 if err != nil {
652 return nil, err
653 }
654
655 wheres, err := i.genCommonWheres(ctx, clusterId)
656 if err != nil {
657 return nil, err
658 }
659
660 if len(input.Services) > 0 {
661 wheres = append(wheres, monitor.MonWhereItem{
662 Key: "provider",
663 Operation: "in",
664 Values: input.Services,
665 })
666 }
667
668 return i.serviceStatistics(ctx, clusterId, services, "provider", formatTimeByMinute(input.Start), formatTimeByMinute(input.End), wheres, 0)
669}
670
671func (i *imlMonitorStatisticModule) APITrend(ctx context.Context, apiId string, input *monitor_dto.CommonInput) (*monitor_dto.MonInvokeCountTrend, string, error) {
672 clusterId := cluster.DefaultClusterID

Callers

nothing calls this directly

Calls 5

genCommonWheresMethod · 0.95
serviceStatisticsMethod · 0.95
formatTimeByMinuteFunction · 0.70
GetMethod · 0.65
ServiceListMethod · 0.65

Tested by

no test coverage detected