log slow queries only when Config.SlowSearchLogThreshold > 0
This commit is contained in:
parent
de0c26718d
commit
21b3d592b8
@ -497,7 +497,8 @@ func (i *indexImpl) SearchInContext(ctx context.Context, req *SearchRequest) (sr
|
|||||||
searchDuration := time.Since(searchStart)
|
searchDuration := time.Since(searchStart)
|
||||||
atomic.AddUint64(&i.stats.searchTime, uint64(searchDuration))
|
atomic.AddUint64(&i.stats.searchTime, uint64(searchDuration))
|
||||||
|
|
||||||
if searchDuration > Config.SlowSearchLogThreshold {
|
if Config.SlowSearchLogThreshold > 0 &&
|
||||||
|
searchDuration > Config.SlowSearchLogThreshold {
|
||||||
logger.Printf("slow search took %s - %v", searchDuration, req)
|
logger.Printf("slow search took %s - %v", searchDuration, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user