report refreshes the telemetry gauges.
(views map[string]*tenantView, desired map[string]string, shardCount, totalHRs, pending int)
| 345 | |
| 346 | // report refreshes the telemetry gauges. |
| 347 | func (r *PlacementReconciler) report(views map[string]*tenantView, desired map[string]string, shardCount, totalHRs, pending int) { |
| 348 | shardLoadGauge.Reset() |
| 349 | load := map[string]int{} |
| 350 | for i := 0; i < shardCount; i++ { |
| 351 | load[ShardName(i)] = 0 |
| 352 | } |
| 353 | for tenantNS, shard := range desired { |
| 354 | load[shard] += views[tenantNS].info.Weight |
| 355 | } |
| 356 | for shard, l := range load { |
| 357 | shardLoadGauge.WithLabelValues(shard).Set(float64(l)) |
| 358 | } |
| 359 | tenantsGauge.Set(float64(len(views))) |
| 360 | helmReleasesGauge.Set(float64(totalHRs)) |
| 361 | pendingMovesGauge.Set(float64(pending)) |
| 362 | recommendedShardsGauge.Set(float64(RecommendedShardCount(totalHRs, len(views)))) |
| 363 | } |
| 364 | |
| 365 | // pruneCooldowns drops cooldown entries for tenants that no longer exist. |
| 366 | func (r *PlacementReconciler) pruneCooldowns(views map[string]*tenantView) { |
no test coverage detected