Skip to content

Commit

Permalink
track validation time
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Aug 21, 2020
1 parent 42cb3f9 commit efd5696
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,11 @@ func (v *validation) validateSingleTopic(val *topicVal, src peer.ID, msg *Messag
}

func (val *topicVal) validateMsg(ctx context.Context, src peer.ID, msg *Message) ValidationResult {
start := time.Now()
defer func() {
log.Debugf("validation done; took %s", time.Since(start))
}()

if val.validateTimeout > 0 {
var cancel func()
ctx, cancel = context.WithTimeout(ctx, val.validateTimeout)
Expand Down

0 comments on commit efd5696

Please sign in to comment.