Просмотр исходного кода

Fix ComputeClusterCosts (empty diff)

Niko Kovacevic 6 лет назад
Родитель
Сommit
50a22ebae3
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      pkg/costmodel/cluster.go

+ 3 - 3
pkg/costmodel/cluster.go

@@ -140,17 +140,17 @@ func ComputeClusterCosts(client prometheus.Client, provider cloud.Provider, wind
 	) by (cluster_id)`
 	) by (cluster_id)`
 
 
 	const fmtQueryTotalCPU = `sum(
 	const fmtQueryTotalCPU = `sum(
-		sum(sum_over_time(avg(kube_node_status_capacity_cpu_cores) by (node, cluster_id)[%s:1m]%s)) by (node, cluster_id) *
+		sum_over_time(avg(kube_node_status_capacity_cpu_cores) by (node, cluster_id)[%s:1m]%s) *
 		avg(avg_over_time(node_cpu_hourly_cost[%s:1m]%s)) by (node, cluster_id) / 60
 		avg(avg_over_time(node_cpu_hourly_cost[%s:1m]%s)) by (node, cluster_id) / 60
 	) by (cluster_id)`
 	) by (cluster_id)`
 
 
 	const fmtQueryTotalRAM = `sum(
 	const fmtQueryTotalRAM = `sum(
-		sum(sum_over_time(avg(kube_node_status_capacity_memory_bytes) by (node, cluster_id)[%s:1m]%s) / 1024 / 1024 / 1024) by (node, cluster_id) *
+		sum_over_time(avg(kube_node_status_capacity_memory_bytes) by (node, cluster_id)[%s:1m]%s) / 1024 / 1024 / 1024 *
 		avg(avg_over_time(node_ram_hourly_cost[%s:1m]%s)) by (node, cluster_id) / 60
 		avg(avg_over_time(node_ram_hourly_cost[%s:1m]%s)) by (node, cluster_id) / 60
 	) by (cluster_id)`
 	) by (cluster_id)`
 
 
 	const fmtQueryTotalStorage = `sum(
 	const fmtQueryTotalStorage = `sum(
-		sum(sum_over_time(avg(kube_persistentvolume_capacity_bytes) by (persistentvolume, cluster_id)[%s:1m]%s)) by (persistentvolume, cluster_id) / 1024 / 1024 / 1024 *
+		sum_over_time(avg(kube_persistentvolume_capacity_bytes) by (persistentvolume, cluster_id)[%s:1m]%s) / 1024 / 1024 / 1024 *
 		avg(avg_over_time(pv_hourly_cost[%s:1m]%s)) by (persistentvolume, cluster_id) / 60
 		avg(avg_over_time(pv_hourly_cost[%s:1m]%s)) by (persistentvolume, cluster_id) / 60
 	) by (cluster_id) %s`
 	) by (cluster_id) %s`