(ctx context.Context, serviceId string, apiKind []string)
| 48 | } |
| 49 | |
| 50 | func (i *imlMonitorStatisticModule) genOverviewWhere(ctx context.Context, serviceId string, apiKind []string) ([]monitor.MonWhereItem, error) { |
| 51 | clusterId := cluster.DefaultClusterID |
| 52 | _, err := i.clusterService.Get(ctx, clusterId) |
| 53 | if err != nil { |
| 54 | return nil, err |
| 55 | } |
| 56 | wheres, err := i.genCommonWheres(ctx, clusterId) |
| 57 | if err != nil { |
| 58 | return nil, err |
| 59 | } |
| 60 | if serviceId != "" { |
| 61 | wheres = append(wheres, monitor.MonWhereItem{ |
| 62 | Key: "provider", |
| 63 | Operation: "=", |
| 64 | Values: []string{serviceId}, |
| 65 | }) |
| 66 | } |
| 67 | if len(apiKind) > 0 { |
| 68 | wheres = append(wheres, monitor.MonWhereItem{ |
| 69 | Key: "api_kind", |
| 70 | Operation: "in", |
| 71 | Values: apiKind, |
| 72 | }) |
| 73 | } |
| 74 | return wheres, nil |
| 75 | } |
| 76 | |
| 77 | func (i *imlMonitorStatisticModule) AIChartOverview(ctx context.Context, serviceId string, start int64, end int64) (*monitor_dto.ChartAIOverview, error) { |
| 78 | wheres, err := i.genOverviewWhere(ctx, serviceId, []string{"ai"}) |
no test coverage detected