(ctx *gin.Context, serviceId string, start string, end string)
| 174 | } |
| 175 | |
| 176 | func (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 | |
| 212 | func (i *imlServiceController) RestChartOverview(ctx *gin.Context, serviceId string, start string, end string) (*monitor_dto.ServiceChartRestOverview, error) { |
| 213 | s, e, err := formatTime(start, end) |
nothing calls this directly
no test coverage detected