mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01:00
app/vmselect/searchutils: do not print flag name responsible for query timeout if the timeout isn't reached
This should make the log message more clear
This commit is contained in:
parent
bce1c5d572
commit
f9730676d9
@ -209,7 +209,7 @@ func (d *Deadline) String() string {
|
|||||||
startTime := time.Unix(int64(d.deadline), 0).Add(-d.timeout)
|
startTime := time.Unix(int64(d.deadline), 0).Add(-d.timeout)
|
||||||
elapsed := time.Since(startTime)
|
elapsed := time.Since(startTime)
|
||||||
msg := fmt.Sprintf("%.3f seconds (elapsed %.3f seconds)", d.timeout.Seconds(), elapsed.Seconds())
|
msg := fmt.Sprintf("%.3f seconds (elapsed %.3f seconds)", d.timeout.Seconds(), elapsed.Seconds())
|
||||||
if d.flagHint != "" {
|
if float64(elapsed)/float64(d.timeout) > 0.9 && d.flagHint != "" {
|
||||||
msg += fmt.Sprintf("; the timeout can be adjusted with `%s` command-line flag", d.flagHint)
|
msg += fmt.Sprintf("; the timeout can be adjusted with `%s` command-line flag", d.flagHint)
|
||||||
}
|
}
|
||||||
return msg
|
return msg
|
||||||
|
Loading…
Reference in New Issue
Block a user