Report if request times out while time matcher / filter is active (#722)

* Report if request times out while time matcher / filter is active

* Add changelog entry

* Fix sprintf statement

* Make linter happy
This commit is contained in:
Joona Hoikkala 2023-09-15 19:04:20 +03:00 committed by GitHub
parent e80fdc47c0
commit e3e4e6250d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View file

@ -10,6 +10,7 @@
- Fix csv output file format
- Fixed divide by 0 error when setting rate limit to 0 manually.
- Automatic brotli and deflate decompression
- Report if request times out when a time based matcher or filter is active
- v2.0.0
- New

View file

@ -411,6 +411,28 @@ func (j *Job) runTask(input map[string][]byte, position int, retried bool) {
} else {
j.runTask(input, position, true)
}
if os.IsTimeout(err) {
for name := range j.Config.MatcherManager.GetMatchers() {
if name == "time" {
inputmsg := ""
for k, v := range input {
inputmsg = inputmsg + fmt.Sprintf("%s : %s // ", k, v)
}
j.Output.Info("Timeout while 'time' matcher is active: " + inputmsg)
return
}
}
for name := range j.Config.MatcherManager.GetFilters() {
if name == "time" {
inputmsg := ""
for k, v := range input {
inputmsg = inputmsg + fmt.Sprintf("%s : %s // ", k, v)
}
j.Output.Info("Timeout while 'time' filter is active: " + inputmsg)
return
}
}
}
return
}
if j.SpuriousErrorCounter > 0 {