Achilleas Tzenetopoulos 5 years ago
parent
commit
ea20bb7383

+ 4 - 5
kubernetes-v1.15.4/pkg/scheduler/algorithm/priorities/node_selection.go

@@ -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))
+		//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) {
 
 	// calculate the number of rows needed
-	// i.e. 20sec / 0.5s interval => 40rows
+	// i.e. 20sec / 0.2s interval => 100rows
 	numberOfRows := int(float32(time) / cfg.MonitoringSpecs.TimeInterval)
 	// EDIT
 	// This time we will fetch data for multiple cores
 	// so we will need more rows, proportional to the core number
-	numberOfRows *= len(cores)
 	// merge all the required columns
 	columns := strings.Join(metrics, ", ")
 
@@ -219,7 +218,7 @@ func queryInfluxDbCores(metrics []string, uuid string, socket,
 	// build the coommand
 	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())
+	//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))
+	//klog.Infof("Node %v has %v cores", nodeName, len(cores))
 	if ok {
 
 		// Select Socket