Skip to content

Commit

Permalink
Merge pull request ipfs/kubo#3189 from ipfs/feat/metrics/interface
Browse files Browse the repository at this point in the history
metrics: introduce go-metrics-interface

This commit was moved from ipfs/kubo@f23cd5c
  • Loading branch information
whyrusleeping committed Sep 20, 2016
2 parents a2b0e46 + b6d8304 commit 8c75ffd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gateway/core/corehttp/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"net"
"net/http"

prometheus "gx/ipfs/QmdhsRK1EK2fvAz2i2SH5DEfkL6seDuyMYEsxKa9Braim3/client_golang/prometheus"

core "github.com/ipfs/go-ipfs/core"

prometheus "gx/ipfs/QmR3KwhXCRLTNZB59vELb2HhEWrGy9nuychepxFtj3wWYa/client_golang/prometheus"
)

// This adds the scraping endpoint which Prometheus uses to fetch metrics.
Expand Down Expand Up @@ -53,6 +53,9 @@ func (c IpfsNodeCollector) Collect(ch chan<- prometheus.Metric) {

func (c IpfsNodeCollector) PeersTotalValues() map[string]float64 {
vals := make(map[string]float64)
if c.Node.PeerHost == nil {
return vals
}
for _, conn := range c.Node.PeerHost.Network().Conns() {
tr := ""
for _, proto := range conn.RemoteMultiaddr().Protocols() {
Expand Down

0 comments on commit 8c75ffd

Please sign in to comment.