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:
commit
549fa53e6f
10
collector.go
10
collector.go
|
@ -52,12 +52,12 @@ var (
|
||||||
Help: "Bytes received from peer node."},
|
Help: "Bytes received from peer node."},
|
||||||
[]string{"addr", "addrlocal", "inbound", "banscore", "subver"},
|
[]string{"addr", "addrlocal", "inbound", "banscore", "subver"},
|
||||||
)
|
)
|
||||||
zcashdChainTips = prometheus.NewGaugeVec(
|
zcashdChainTipLength = prometheus.NewGaugeVec(
|
||||||
prometheus.GaugeOpts{
|
prometheus.GaugeOpts{
|
||||||
Name: "zcash_chainips_at_height",
|
Name: "zcash_chainip_length",
|
||||||
Help: "Information about all known tips in the block tree.",
|
Help: "Chain tip length",
|
||||||
},
|
},
|
||||||
[]string{"hash", "branchlen", "status"},
|
[]string{"hash", "status", "height"},
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -97,5 +97,5 @@ func init() {
|
||||||
prometheus.MustRegister(zcashdPeerConnTime)
|
prometheus.MustRegister(zcashdPeerConnTime)
|
||||||
prometheus.MustRegister(zcashdPeerBytesSent)
|
prometheus.MustRegister(zcashdPeerBytesSent)
|
||||||
prometheus.MustRegister(zcashdPeerBytesRecv)
|
prometheus.MustRegister(zcashdPeerBytesRecv)
|
||||||
prometheus.MustRegister(zcashdChainTips)
|
prometheus.MustRegister(zcashdChainTipLength)
|
||||||
}
|
}
|
||||||
|
|
6
main.go
6
main.go
|
@ -223,11 +223,11 @@ func getChainTips() {
|
||||||
} else {
|
} else {
|
||||||
for _, ct := range *chaintips {
|
for _, ct := range *chaintips {
|
||||||
log.Infoln("Got chaintip: ", ct.Hash)
|
log.Infoln("Got chaintip: ", ct.Hash)
|
||||||
zcashdChainTips.WithLabelValues(
|
zcashdChainTipLength.WithLabelValues(
|
||||||
ct.Hash,
|
ct.Hash,
|
||||||
strconv.Itoa(ct.Branchlen),
|
|
||||||
ct.Status,
|
ct.Status,
|
||||||
).Set(float64(ct.Height))
|
strconv.Itoa(ct.Height),
|
||||||
|
).Set(float64(ct.Branchlen))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
time.Sleep(time.Duration(30) * time.Second)
|
time.Sleep(time.Duration(30) * time.Second)
|
||||||
|
|
Loading…
Reference in New Issue