コード例 #1
0
ファイル: metrics.go プロジェクト: Kubuxu/go-ipfs
func (c IpfsNodeCollector) Collect(ch chan<- prometheus.Metric) {
	ch <- prometheus.MustNewConstMetric(
		peersTotalMetric,
		prometheus.GaugeValue,
		c.PeersTotalValue(),
	)
}
コード例 #2
0
ファイル: metrics.go プロジェクト: ccsblueboy/go-ipfs
func (c IpfsNodeCollector) Collect(ch chan<- prometheus.Metric) {
	for tr, val := range c.PeersTotalValues() {
		ch <- prometheus.MustNewConstMetric(
			peersTotalMetric,
			prometheus.GaugeValue,
			val,
			tr,
		)
	}
}