Browse Source

some logging

Achilleas Tzenetopoulos 5 years ago
parent
commit
edd3e0bc41

+ 6 - 2
kubernetes-v1.15.4/pkg/scheduler/algorithm/priorities/custom_resource_allocation.go

@@ -104,7 +104,9 @@ func customResourceScorer(nodeName string) int64 {
 		Addr: "http://" + cfg.Server.Host + ":" + cfg.Server.Port + "",
 		Addr: "http://" + cfg.Server.Host + ":" + cfg.Server.Port + "",
 	})
 	})
 	if err != nil {
 	if err != nil {
-		fmt.Println("Error while creating InfluxDB client: ", err.Error())
+		klog.Infof("Error while creating InfluxDB client: %v ", err.Error())
+	} else {
+		klog.Infof("Connected Successfully to InfluxDB")
 	}
 	}
 
 
 	// close the connection in the end of execution
 	// close the connection in the end of execution
@@ -117,8 +119,10 @@ func customResourceScorer(nodeName string) int64 {
 		command := fmt.Sprintf("SELECT ipc from system_metrics where uuid = %s order by time desc limit 1", curr_uuid)
 		command := fmt.Sprintf("SELECT ipc from system_metrics where uuid = %s order by time desc limit 1", curr_uuid)
 		q := client.NewQuery(command, "evolve", "")
 		q := client.NewQuery(command, "evolve", "")
 		if response, err := c.Query(q); err == nil && response.Error() == nil {
 		if response, err := c.Query(q); err == nil && response.Error() == nil {
-			fmt.Println(response.Results)
+			klog.Infof("%v", response.Results)
 		}
 		}
+	} else {
+		klog.Infof("Something went wrong with InfluxDB metrics extraction: %v", ok)
 	}
 	}
 
 
 	// //Close the database connection in the end of the execution
 	// //Close the database connection in the end of the execution