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

Method ServiceOverview

controller/service/iml.go:147–174  ·  view source on GitHub ↗
(ctx *gin.Context, serviceId string)

Source from the content-addressed store, hash-verified

145}
146
147func (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
176func (i *imlServiceController) AIChartOverview(ctx *gin.Context, serviceId string, start string, end string) (*monitor_dto.ServiceChartAIOverview, error) {
177 s, e, err := formatTime(start, end)

Callers

nothing calls this directly

Calls 3

ServiceOverviewMethod · 0.65
GetMonitorConfigMethod · 0.65
ProviderStatisticsMethod · 0.65

Tested by

no test coverage detected