cmd/rpc/slots: apply -type to printing only

This commit is contained in:
Leopold Schabel 2022-06-15 22:10:20 +02:00
parent 8356f43d60
commit 989ee15a55
1 changed files with 4 additions and 4 deletions

View File

@ -142,10 +142,6 @@ func watchSlotUpdates(ctx context.Context, node *envv1.RPCNode, highest *sync.Ma
ts := m.Timestamp.Time()
delay := time.Since(ts)
if *flagType != "" && string(m.Type) != *flagType {
continue
}
sched.Update(m.Slot)
var first time.Time
@ -170,6 +166,10 @@ func watchSlotUpdates(ctx context.Context, node *envv1.RPCNode, highest *sync.Ma
prop = -1
}
if *flagType != "" && string(m.Type) != *flagType {
continue
}
klog.Infof("%s: slot=%d type=%s delay=%dms prop=%dms parent=%d stats=%v leader=%s",
node.Name, m.Slot, m.Type, delay.Milliseconds(), prop, m.Parent, m.Stats, sched.Get(m.Slot))
}