* querylog, stats: don't print unnecessary log messages

This commit is contained in:
Simon Zolin
2019-10-07 12:03:56 +03:00
parent 8b7d23e7d0
commit c9b4a0742f
2 changed files with 6 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"time"
"github.com/AdguardTeam/golibs/log"
)
@@ -24,9 +25,10 @@ func (s *statsCtx) handleStats(w http.ResponseWriter, r *http.Request) {
if s.limit/24 > 7 {
units = Days
}
counter := log.StartTimer()
start := time.Now()
d := s.getData(units)
counter.LogElapsed("Stats: prepared data")
log.Debug("Stats: prepared data in %v", time.Since(start))
if d == nil {
httpError(r, w, http.StatusInternalServerError, "Couldn't get statistics data")