Commit 48557a16 authored by Bobby (Babak) Salamat's avatar Bobby (Babak) Salamat

fixup! Add a scheduler cache dumper

parent 4bb57c44
...@@ -37,21 +37,21 @@ type CacheDumper struct { ...@@ -37,21 +37,21 @@ type CacheDumper struct {
// DumpAll writes cached nodes and scheduling queue information to the scheduler logs. // DumpAll writes cached nodes and scheduling queue information to the scheduler logs.
func (d *CacheDumper) DumpAll() { func (d *CacheDumper) DumpAll() {
d.DumpNodes() d.dumpNodes()
d.DumpSchedulingQueue() d.dumpSchedulingQueue()
} }
// DumpNodes writes NodeInfo to the scheduler logs. // dumpNodes writes NodeInfo to the scheduler logs.
func (d *CacheDumper) DumpNodes() { func (d *CacheDumper) dumpNodes() {
snapshot := d.cache.Snapshot() snapshot := d.cache.Snapshot()
glog.Info("Dump of cached NodeInfo") glog.Info("Dump of cached NodeInfo")
for _, info := range snapshot.Nodes { for _, nodeInfo := range snapshot.Nodes {
glog.Info(printNodeInfo(info)) glog.Info(printNodeInfo(nodeInfo))
} }
} }
// DumpSchedulingQueue writes pods in the scheduling queue to the scheduler logs. // dumpSchedulingQueue writes pods in the scheduling queue to the scheduler logs.
func (d *CacheDumper) DumpSchedulingQueue() { func (d *CacheDumper) dumpSchedulingQueue() {
waitingPods := d.podQueue.WaitingPods() waitingPods := d.podQueue.WaitingPods()
var podData strings.Builder var podData strings.Builder
for _, p := range waitingPods { for _, p := range waitingPods {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment