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

Method APITrend

module/monitor/iml.go:671–691  ·  view source on GitHub ↗
(ctx context.Context, apiId string, input *monitor_dto.CommonInput)

Source from the content-addressed store, hash-verified

669}
670
671func (i *imlMonitorStatisticModule) APITrend(ctx context.Context, apiId string, input *monitor_dto.CommonInput) (*monitor_dto.MonInvokeCountTrend, string, error) {
672 clusterId := cluster.DefaultClusterID
673 wheres, err := i.genCommonWheres(ctx, clusterId)
674 if err != nil {
675 return nil, "", err
676 }
677 wheres = append(wheres, monitor.MonWhereItem{
678 Key: "api",
679 Operation: "=",
680 Values: []string{apiId},
681 })
682 executor, err := i.getExecutor(ctx, clusterId)
683 if err != nil {
684 return nil, "", err
685 }
686 result, timeInterval, err := executor.InvokeTrend(ctx, formatTimeByMinute(input.Start), formatTimeByMinute(input.End), wheres)
687 if err != nil {
688 return nil, "", err
689 }
690 return monitor_dto.ToMonInvokeCountTrend(result), timeInterval, nil
691}
692
693func (i *imlMonitorStatisticModule) ProviderTrend(ctx context.Context, providerId string, input *monitor_dto.CommonInput) (*monitor_dto.MonInvokeCountTrend, string, error) {
694 clusterId := cluster.DefaultClusterID

Callers

nothing calls this directly

Calls 4

genCommonWheresMethod · 0.95
getExecutorMethod · 0.95
formatTimeByMinuteFunction · 0.70
InvokeTrendMethod · 0.65

Tested by

no test coverage detected