(ctx context.Context, clusterIds ...string)
| 157 | } |
| 158 | |
| 159 | func (i *imlCatalogueModule) genCommonWheres(ctx context.Context, clusterIds ...string) ([]monitor.MonWhereItem, error) { |
| 160 | |
| 161 | clusters, err := i.clusterService.List(ctx, clusterIds...) |
| 162 | if err != nil { |
| 163 | return nil, err |
| 164 | } |
| 165 | clusterIds = utils.SliceToSlice(clusters, func(item *cluster.Cluster) string { |
| 166 | return item.Uuid |
| 167 | }) |
| 168 | |
| 169 | wheres := make([]monitor.MonWhereItem, 0, 1) |
| 170 | nodes, err := i.clusterService.Nodes(ctx, clusterIds...) |
| 171 | if err != nil { |
| 172 | return nil, err |
| 173 | } |
| 174 | nodeIds := utils.SliceToSlice(nodes, func(s *cluster.Node) string { |
| 175 | return s.Name |
| 176 | }) |
| 177 | wheres = append(wheres, monitor.MonWhereItem{ |
| 178 | Key: "node", |
| 179 | Operation: "in", |
| 180 | Values: nodeIds, |
| 181 | }) |
| 182 | |
| 183 | return wheres, nil |
| 184 | } |
| 185 | |
| 186 | func (i *imlCatalogueModule) ProviderStatistics(ctx context.Context, start, end time.Time, serviceIds ...string) (map[string]int64, error) { |
| 187 | // 判断是否配置influxdb |
no test coverage detected