MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / StatisticsInner

Method StatisticsInner

controller/monitor/iml.go:116–143  ·  view source on GitHub ↗
(ctx *gin.Context, dataType string, typ string, id string, input *monitor_dto.StatisticInput)

Source from the content-addressed store, hash-verified

114}
115
116func (i *imlMonitorStatisticController) StatisticsInner(ctx *gin.Context, dataType string, typ string, id string, input *monitor_dto.StatisticInput) (interface{}, error) {
117 switch dataType {
118 case monitor_dto.DataTypeApi:
119 switch typ {
120 case monitor_dto.DataTypeProvider:
121 return i.module.ProviderStatisticsOnApi(ctx, id, input)
122 case monitor_dto.DataTypeSubscriber:
123 return i.module.SubscriberStatisticsOnApi(ctx, id, input)
124 default:
125 return nil, fmt.Errorf("unsupported detail type: %s, data type is %s", typ, dataType)
126 }
127 case monitor_dto.DataTypeProvider:
128 switch typ {
129 case monitor_dto.DataTypeApi:
130 return i.module.ApiStatisticsOnProvider(ctx, id, input)
131 default:
132 return nil, fmt.Errorf("unsupported detail type: %s, data type is %s", typ, dataType)
133 }
134 case monitor_dto.DataTypeSubscriber:
135 switch typ {
136 case monitor_dto.DataTypeApi:
137 return i.module.ApiStatisticsOnSubscriber(ctx, id, input)
138 default:
139 return nil, fmt.Errorf("unsupported detail type: %s, data type is %s", typ, dataType)
140 }
141 }
142 return nil, fmt.Errorf("unsupported data type: %s", dataType)
143}
144
145func (i *imlMonitorStatisticController) OverviewMessageTrend(ctx *gin.Context, input *monitor_dto.CommonInput) ([]time.Time, []float64, []float64, string, error) {
146 trend, timeInterval, err := i.module.MessageTrend(ctx, input)

Callers

nothing calls this directly

Tested by

no test coverage detected