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

Method SubscriberTrend

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

Source from the content-addressed store, hash-verified

713}
714
715func (i *imlMonitorStatisticModule) SubscriberTrend(ctx context.Context, subscriberId string, input *monitor_dto.CommonInput) (*monitor_dto.MonInvokeCountTrend, string, error) {
716 clusterId := cluster.DefaultClusterID
717 wheres, err := i.genCommonWheres(ctx, clusterId)
718 if err != nil {
719 return nil, "", err
720 }
721 wheres = append(wheres, monitor.MonWhereItem{
722 Key: "app",
723 Operation: "=",
724 Values: []string{subscriberId},
725 })
726 executor, err := i.getExecutor(ctx, clusterId)
727 if err != nil {
728 return nil, "", err
729 }
730 result, timeInterval, err := executor.InvokeTrend(ctx, formatTimeByMinute(input.Start), formatTimeByMinute(input.End), wheres)
731 if err != nil {
732 return nil, "", err
733 }
734 return monitor_dto.ToMonInvokeCountTrend(result), timeInterval, nil
735}
736
737func (i *imlMonitorStatisticModule) InvokeTrendWithSubscriberAndApi(ctx context.Context, apiId string, subscriberId string, input *monitor_dto.CommonInput) (*monitor_dto.MonInvokeCountTrend, string, error) {
738 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