fixup! Add a scheduler cache dumper

pull/58/head
Bobby (Babak) Salamat 2018-11-06 10:08:22 -08:00
parent 4bb57c440e
commit 48557a163a
1 changed files with 8 additions and 8 deletions

View File

@ -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 {