From efd56962bced7064fce46dc412971c1182a807f1 Mon Sep 17 00:00:00 2001 From: vyzo Date: Fri, 21 Aug 2020 10:25:21 +0300 Subject: [PATCH] track validation time --- validation.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/validation.go b/validation.go index 977403ae..c922c59c 100644 --- a/validation.go +++ b/validation.go @@ -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)