mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-27 09:18:58 +03:00
Merge: - querylog: remove time counter (fix zero div exception)
Close #1194 * commit 'a31116635e605d199887e83a98d27f0fe01291c1': * querylog: delete code for time counter - querylog: remove time counter (fix zero div exception)
This commit is contained in:
commit
2e5264652e
1 changed files with 2 additions and 7 deletions
|
@ -171,8 +171,6 @@ type Reader struct {
|
|||
fseeker fileSeeker // file seeker object
|
||||
fpos uint64 // current file offset
|
||||
nSeekRequests uint32 // number of Seek() requests made (finding a new line doesn't count)
|
||||
|
||||
timecnt uint64
|
||||
}
|
||||
|
||||
type fileSeeker struct {
|
||||
|
@ -205,8 +203,8 @@ func (r *Reader) Close() {
|
|||
if r.count > 0 {
|
||||
perunit = elapsed / time.Duration(r.count)
|
||||
}
|
||||
log.Debug("querylog: read %d entries in %v, %v/entry, seek-reqs:%d time:%dus (%d%%)",
|
||||
r.count, elapsed, perunit, r.nSeekRequests, r.timecnt/1000, r.timecnt*100/uint64(elapsed.Nanoseconds()))
|
||||
log.Debug("querylog: read %d entries in %v, %v/entry, seek-reqs:%d",
|
||||
r.count, elapsed, perunit, r.nSeekRequests)
|
||||
|
||||
if r.f != nil {
|
||||
r.f.Close()
|
||||
|
@ -717,11 +715,8 @@ func (r *Reader) Next() *logEntry { // nolint
|
|||
continue
|
||||
}
|
||||
|
||||
st := time.Now()
|
||||
var ent logEntry
|
||||
decode(&ent, str)
|
||||
r.timecnt += uint64(time.Now().Sub(st).Nanoseconds())
|
||||
|
||||
return &ent
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue