|
@@ -159,7 +159,7 @@ func calculateWeightedAverageCores(response *client.Response,
|
|
|
metrics := make(map[string]float64, numberOfMetrics)
|
|
|
rows := response.Results[0].Series[0]
|
|
|
for i := 1; i < len(rows.Columns); i++ {
|
|
|
- klog.Infof("Name of column %v : %v\n range of values: %v", i, rows.Columns[i], len(rows.Values))
|
|
|
+
|
|
|
for j := 0; j < numberOfRows; j++ {
|
|
|
avg := 0.0
|
|
|
for k := 0; k < numberOfCores; k++ {
|
|
@@ -200,12 +200,11 @@ func queryInfluxDbCores(metrics []string, uuid string, socket,
|
|
|
time int, cfg Config, c client.Client, cores []int) (map[string]float64, error) {
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
numberOfRows := int(float32(time) / cfg.MonitoringSpecs.TimeInterval)
|
|
|
|
|
|
|
|
|
|
|
|
- numberOfRows *= len(cores)
|
|
|
|
|
|
columns := strings.Join(metrics, ", ")
|
|
|
|
|
@@ -219,7 +218,7 @@ func queryInfluxDbCores(metrics []string, uuid string, socket,
|
|
|
|
|
|
var command strings.Builder
|
|
|
fmt.Fprintf(&command, "SELECT %s from core_metrics where uuid = '%s' and socket_id='%d' and %s order by time desc limit %d", columns, uuid, socket, coresPart.String(), numberOfRows)
|
|
|
- klog.Infof("The query is: %v", command.String())
|
|
|
+
|
|
|
q := client.NewQuery(command.String(), cfg.Database.Name, "")
|
|
|
response, err := c.Query(q)
|
|
|
if err != nil {
|
|
@@ -261,7 +260,7 @@ func nodeSelectionScorer(nodeName string) (float64, error) {
|
|
|
return 0.0, nil
|
|
|
}
|
|
|
|
|
|
- klog.Infof("Node %v has %v cores", nodeName, len(cores))
|
|
|
+
|
|
|
if ok {
|
|
|
|
|
|
|