Skip to content

Commit

Permalink
Merge pull request ethereum#597 from ethersphere/fix_counter_timer_na…
Browse files Browse the repository at this point in the history
…ming

p2p, swarm: use different names for counter and timer
  • Loading branch information
nonsense authored May 24, 2018
2 parents 5685cc2 + b262996 commit 52ad151
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion p2p/protocols/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (p *Peer) Drop(err error) {
// this low level call will be wrapped by libraries providing routed or broadcast sends
// but often just used to forward and push messages to directly connected peers
func (p *Peer) Send(msg interface{}) error {
defer metrics.GetOrRegisterResettingTimer("peer.send", nil).UpdateSince(time.Now())
defer metrics.GetOrRegisterResettingTimer("peer.send_t", nil).UpdateSince(time.Now())
metrics.GetOrRegisterCounter("peer.send", nil).Inc(1)
code, found := p.spec.GetCode(msg)
if !found {
Expand Down
2 changes: 1 addition & 1 deletion swarm/network/stream/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (p *Peer) Deliver(chunk *storage.Chunk, priority uint8) error {

// SendPriority sends message to the peer using the outgoing priority queue
func (p *Peer) SendPriority(msg interface{}, priority uint8) error {
defer metrics.GetOrRegisterResettingTimer(fmt.Sprintf("peer.sendpriority.%d", priority), nil).UpdateSince(time.Now())
defer metrics.GetOrRegisterResettingTimer(fmt.Sprintf("peer.sendpriority_t.%d", priority), nil).UpdateSince(time.Now())
metrics.GetOrRegisterCounter(fmt.Sprintf("peer.sendpriority.%d", priority), nil).Inc(1)
ctx, cancel := context.WithTimeout(context.Background(), sendTimeout)
defer cancel()
Expand Down

0 comments on commit 52ad151

Please sign in to comment.