|
@@ -1546,11 +1546,13 @@ func (cm *CostModel) costDataRange(cli prometheusClient.Client, clientset kubern
|
|
|
start, end, window, err.Error())
|
|
start, end, window, err.Error())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ profileStart := time.Now()
|
|
|
nodes, err := cm.GetNodeCost(cp)
|
|
nodes, err := cm.GetNodeCost(cp)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
klog.V(1).Infof("Warning, no cost model available: " + err.Error())
|
|
klog.V(1).Infof("Warning, no cost model available: " + err.Error())
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
|
|
|
+ measureTime(profileStart, "GetNodeCost")
|
|
|
|
|
|
|
|
pvClaimMapping, err := GetPVInfo(resultPVRequests, clusterID)
|
|
pvClaimMapping, err := GetPVInfo(resultPVRequests, clusterID)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -1628,6 +1630,8 @@ func (cm *CostModel) costDataRange(cli prometheusClient.Client, clientset kubern
|
|
|
networkUsageMap = make(map[string]*NetworkUsageData)
|
|
networkUsageMap = make(map[string]*NetworkUsageData)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ profileStart = time.Now()
|
|
|
|
|
+
|
|
|
containerNameCost := make(map[string]*CostData)
|
|
containerNameCost := make(map[string]*CostData)
|
|
|
containers := make(map[string]bool)
|
|
containers := make(map[string]bool)
|
|
|
otherClusterPVRecorded := make(map[string]bool)
|
|
otherClusterPVRecorded := make(map[string]bool)
|
|
@@ -1684,6 +1688,8 @@ func (cm *CostModel) costDataRange(cli prometheusClient.Client, clientset kubern
|
|
|
containers[key] = true
|
|
containers[key] = true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ measureTime(profileStart, "GetContainerMetricVectors")
|
|
|
|
|
+
|
|
|
// Request metrics can show up after pod eviction and completion.
|
|
// Request metrics can show up after pod eviction and completion.
|
|
|
// This method synchronizes requests to allocations such that when
|
|
// This method synchronizes requests to allocations such that when
|
|
|
// allocation is 0, so are requests
|
|
// allocation is 0, so are requests
|
|
@@ -1705,6 +1711,8 @@ func (cm *CostModel) costDataRange(cli prometheusClient.Client, clientset kubern
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ profileStart = time.Now()
|
|
|
|
|
+
|
|
|
missingNodes := make(map[string]*costAnalyzerCloud.Node)
|
|
missingNodes := make(map[string]*costAnalyzerCloud.Node)
|
|
|
missingContainers := make(map[string]*CostData)
|
|
missingContainers := make(map[string]*CostData)
|
|
|
for key := range containers {
|
|
for key := range containers {
|
|
@@ -2004,6 +2012,8 @@ func (cm *CostModel) costDataRange(cli prometheusClient.Client, clientset kubern
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ measureTime(profileStart, "Build CostData map")
|
|
|
|
|
+
|
|
|
w := end.Sub(start)
|
|
w := end.Sub(start)
|
|
|
w += window
|
|
w += window
|
|
|
if w.Minutes() > 0 {
|
|
if w.Minutes() > 0 {
|