Merge pull request #12 from benzcash/ben/Use-zcash_chainip_length-instead-of-zcash_chainips

Use zcash_chainip_length instead of zcash_chainips_at_height
This commit is contained in:
Ben Wilson 2019-12-09 10:58:13 -05:00 committed by GitHub
commit 549fa53e6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -52,12 +52,12 @@ var (
Help: "Bytes received from peer node."},
[]string{"addr", "addrlocal", "inbound", "banscore", "subver"},
)
zcashdChainTips = prometheus.NewGaugeVec(
zcashdChainTipLength = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "zcash_chainips_at_height",
Help: "Information about all known tips in the block tree.",
Name: "zcash_chainip_length",
Help: "Chain tip length",
},
[]string{"hash", "branchlen", "status"},
[]string{"hash", "status", "height"},
)
)
@ -97,5 +97,5 @@ func init() {
prometheus.MustRegister(zcashdPeerConnTime)
prometheus.MustRegister(zcashdPeerBytesSent)
prometheus.MustRegister(zcashdPeerBytesRecv)
prometheus.MustRegister(zcashdChainTips)
prometheus.MustRegister(zcashdChainTipLength)
}

View File

@ -223,11 +223,11 @@ func getChainTips() {
} else {
for _, ct := range *chaintips {
log.Infoln("Got chaintip: ", ct.Hash)
zcashdChainTips.WithLabelValues(
zcashdChainTipLength.WithLabelValues(
ct.Hash,
strconv.Itoa(ct.Branchlen),
ct.Status,
).Set(float64(ct.Height))
strconv.Itoa(ct.Height),
).Set(float64(ct.Branchlen))
}
}
time.Sleep(time.Duration(30) * time.Second)