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

Method AIChartOverview

controller/service/iml.go:176–210  ·  view source on GitHub ↗
(ctx *gin.Context, serviceId string, start string, end string)

Source from the content-addressed store, hash-verified

174}
175
176func (i *imlServiceController) AIChartOverview(ctx *gin.Context, serviceId string, start string, end string) (*monitor_dto.ServiceChartAIOverview, error) {
177 s, e, err := formatTime(start, end)
178 if err != nil {
179 return nil, err
180 }
181 if serviceId == "" {
182 return nil, fmt.Errorf("service is required")
183 }
184 so, err := i.module.ServiceOverview(ctx, serviceId)
185 if err != nil {
186 return nil, err
187 }
188 result := &monitor_dto.ServiceChartAIOverview{
189 EnableMCP: so.EnableMCP,
190 SubscriberNum: so.SubscriberNum,
191 APINum: so.APINum,
192 ServiceKind: so.ServiceKind,
193 }
194 cfg, err := i.monitorConfigModule.GetMonitorConfig(ctx)
195 if err != nil {
196 return nil, err
197 }
198 if len(cfg.Config) < 1 {
199 return result, nil
200 }
201
202 o, err := i.monitorModule.AIChartOverview(ctx, serviceId, s, e)
203 if err != nil {
204 return nil, err
205 }
206
207 result.AvailableMonitor = true
208 result.ChartAIOverview = o
209 return result, nil
210}
211
212func (i *imlServiceController) RestChartOverview(ctx *gin.Context, serviceId string, start string, end string) (*monitor_dto.ServiceChartRestOverview, error) {
213 s, e, err := formatTime(start, end)

Callers

nothing calls this directly

Calls 4

formatTimeFunction · 0.70
ServiceOverviewMethod · 0.65
GetMonitorConfigMethod · 0.65
AIChartOverviewMethod · 0.65

Tested by

no test coverage detected