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

Method genOverviewWhere

module/monitor/iml.go:50–75  ·  view source on GitHub ↗
(ctx context.Context, serviceId string, apiKind []string)

Source from the content-addressed store, hash-verified

48}
49
50func (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
77func (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"})

Callers 3

AIChartOverviewMethod · 0.95
RestChartOverviewMethod · 0.95
TopMethod · 0.95

Calls 2

genCommonWheresMethod · 0.95
GetMethod · 0.65

Tested by

no test coverage detected