瀏覽代碼

fix offset

AjayTripathy 6 年之前
父節點
當前提交
3c1a6a1962
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      costmodel/cluster.go

+ 1 - 3
costmodel/cluster.go

@@ -144,9 +144,7 @@ func resultToTotal(qr interface{}) (map[string][][]string, error) {
 // ClusterCostsForAllClusters gives the cluster costs averaged over a window of time for all clusters.
 // ClusterCostsForAllClusters gives the cluster costs averaged over a window of time for all clusters.
 func ClusterCostsForAllClusters(cli prometheusClient.Client, cloud costAnalyzerCloud.Provider, windowString, offset string) (map[string]*Totals, error) {
 func ClusterCostsForAllClusters(cli prometheusClient.Client, cloud costAnalyzerCloud.Provider, windowString, offset string) (map[string]*Totals, error) {
 
 
-	if offset != "" {
-		offset = fmt.Sprintf("offset 3h") // Set offset to 3h for block sync
-	}
+	offset = fmt.Sprintf("offset 3h") // Set offset to 3h for block sync
 
 
 	qCores := fmt.Sprintf(queryClusterCores, offset, offset, offset)
 	qCores := fmt.Sprintf(queryClusterCores, offset, offset, offset)
 	qRAM := fmt.Sprintf(queryClusterRAM, offset, offset)
 	qRAM := fmt.Sprintf(queryClusterRAM, offset, offset)