Skip to content

Commit

Permalink
dht_net: more consistent event logging for dhtSendMessage; measure la…
Browse files Browse the repository at this point in the history
…tency
  • Loading branch information
vyzo committed Sep 17, 2017
1 parent a4ee75c commit 1f9fe55
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions dht_net.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ func (ms *messageSender) prep() error {
const streamReuseTries = 3

func (ms *messageSender) SendMessage(ctx context.Context, pmes *pb.Message) error {
defer log.EventBegin(ctx, "dhtSendMessage", ms.dht.self, ms.p, pmes).Done()
ms.lk.Lock()
defer ms.lk.Unlock()
retry := false
Expand All @@ -201,8 +202,6 @@ func (ms *messageSender) SendMessage(ctx context.Context, pmes *pb.Message) erro
}
}

log.Event(ctx, "dhtSentMessage", ms.dht.self, ms.p, pmes)

if retry {
ms.singleMes++
if ms.singleMes > streamReuseTries {
Expand Down Expand Up @@ -244,8 +243,6 @@ func (ms *messageSender) SendRequest(ctx context.Context, pmes *pb.Message) (*pb
}
}

log.Event(ctx, "dhtSentMessage", ms.dht.self, ms.p, pmes)

resch := make(chan requestResult, 1)
select {
case ms.rch <- resch:
Expand Down

0 comments on commit 1f9fe55

Please sign in to comment.