Browse Source

added in-memory

Achilleas Tzenetopoulos 5 years ago
parent
commit
29ecceeb5b

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

@@ -136,6 +136,8 @@ func customResourceScorer(nodeName string) (float64, error) {
 			"mem_read":  reads,
 			"mem_write": writes,
 		}
+
+		klog.Infof("Found in the cache: ipc: %v, reads: %v, writes: %v", ipc, reads, writes)
 		res := calculateScore(scorerInput{metrics: results}, customScoreFn)
 
 		if sum := c6res * float64(len(cores)); sum < 1 {

+ 2 - 1
kubernetes-v1.15.4/pkg/scheduler/core/generic_scheduler.go

@@ -313,7 +313,8 @@ func (g *genericScheduler) Schedule(pod *v1.Pod, nodeLister algorithm.NodeLister
 	podName := pod.ObjectMeta.Name
 
 	for _, n := range socketNodes {
-		klog.Infof("Update Score for Node %v, using App: %v", n,podName)
+		klog.Infof("Update Score for Node %v, using App: %v", n, podName)
+		klog.Infof("App metrics: %v", priorities.Applications[podName].Metrics)
 		numCores := len(priorities.Cores[n])
 		customcache.LabCache.AddAppMetrics(priorities.Applications[podName].Metrics, n, numCores)
 	}

+ 4 - 6
kubernetes-v1.15.4/pkg/scheduler/customcache/cache.go

@@ -2,8 +2,6 @@ package customcache
 
 import (
 	"sync"
-
-	"k8s.io/klog"
 )
 
 //var timeout *time.Ticker = time.NewTicker(time.Duration(10 * time.Second))
@@ -131,7 +129,7 @@ func (c *MlabCache) UpdateCache(input map[string]float64, c6res float64, nodenam
 	}
 	c.Mux.Unlock()
 
-	klog.Infof("After cache update")
+	//klog.Infof("After cache update")
 	c.printCached(nodename)
 	return nil
 }
@@ -150,11 +148,11 @@ func (c *MlabCache) AddAppMetrics(app map[string]float64, nodename string, numCo
 	//TODO
 	// handle ipc addition
 	c.Mux.Unlock()
-	klog.Infof("After application metrics addition")
+	//klog.Infof("After application metrics addition")
 	c.printCached(nodename)
 }
 
 func (c *MlabCache) printCached(nodename string) {
-	klog.Infof("IPC: %v, Reads: %v,  Writes: %v, C6res: %v", c.Cache[nodename]["ipc"], c.Cache[nodename]["mem_read"],
-		c.Cache[nodename]["mem_write"], c.Cache[nodename]["c6res"])
+	//klog.Infof("IPC: %v, Reads: %v,  Writes: %v, C6res: %v", c.Cache[nodename]["ipc"], c.Cache[nodename]["mem_read"],
+	//c.Cache[nodename]["mem_write"], c.Cache[nodename]["c6res"])
 }