Add metrics to SetAuditorHead and Distinguished updates
Some checks failed
CI / test (push) Has been cancelled
Some checks failed
CI / test (push) Has been cancelled
This commit is contained in:
parent
3758e05dd2
commit
92bd50c0e2
@ -67,6 +67,12 @@ func distinguishedUpdate(updateHandler *KtUpdateHandler) {
|
||||
}, 5*time.Second)
|
||||
metrics.IncrCounterWithLabels([]string{"distinguished_update"}, 1, []metrics.Label{successLabel(err)})
|
||||
if err == nil {
|
||||
treeHead, _, err := updateHandler.tx.GetHead()
|
||||
if err != nil {
|
||||
util.Log().Warnf("failed to fetch head: %v", err)
|
||||
return
|
||||
}
|
||||
metrics.SetGauge([]string{"distinguished.tree_size"}, float32(treeHead.TreeSize))
|
||||
return
|
||||
}
|
||||
util.Log().Warnf("Failed to update distinguished key: %v", err)
|
||||
|
||||
@ -1043,6 +1043,10 @@ func (t *Tree) SetAuditorHead(head *pb.AuditorTreeHead, auditorName string) erro
|
||||
return err
|
||||
}
|
||||
|
||||
labels := []metrics.Label{{"auditor", auditorName}}
|
||||
metrics.SetGaugeWithLabels([]string{"set_auditor_head.signature_latency_seconds"}, float32(time.Duration(now-then)/time.Second), labels)
|
||||
metrics.SetGaugeWithLabels([]string{"set_auditor_head.tree_size"}, float32(head.TreeSize), labels)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user