Commit efd56962 authored by vyzo's avatar vyzo

track validation time

parent 42cb3f98
...@@ -416,6 +416,11 @@ func (v *validation) validateSingleTopic(val *topicVal, src peer.ID, msg *Messag ...@@ -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 { 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 { if val.validateTimeout > 0 {
var cancel func() var cancel func()
ctx, cancel = context.WithTimeout(ctx, val.validateTimeout) ctx, cancel = context.WithTimeout(ctx, val.validateTimeout)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment