(ctx *gin.Context, serviceId string)
| 145 | } |
| 146 | |
| 147 | func (i *imlServiceController) ServiceOverview(ctx *gin.Context, serviceId string) (*service_dto.Overview, error) { |
| 148 | o, err := i.module.ServiceOverview(ctx, serviceId) |
| 149 | if err != nil { |
| 150 | return nil, err |
| 151 | } |
| 152 | cfg, err := i.monitorConfigModule.GetMonitorConfig(ctx) |
| 153 | if err != nil { |
| 154 | return nil, err |
| 155 | } |
| 156 | if len(cfg.Config) < 1 { |
| 157 | return o, nil |
| 158 | } |
| 159 | statistics, err := i.monitorModule.ProviderStatistics(ctx, &monitor_dto.StatisticInput{ |
| 160 | Services: []string{serviceId}, |
| 161 | CommonInput: &monitor_dto.CommonInput{ |
| 162 | Start: time.Now().Add(-24 * 30 * time.Hour).Unix(), |
| 163 | End: time.Now().Unix(), |
| 164 | }, |
| 165 | }) |
| 166 | if err != nil { |
| 167 | return nil, err |
| 168 | } |
| 169 | if len(statistics) < 1 { |
| 170 | return o, nil |
| 171 | } |
| 172 | o.InvokeNum = statistics[0].RequestTotal |
| 173 | return o, nil |
| 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) |
nothing calls this directly
no test coverage detected