Skip to content

Commit

Permalink
Let statSawRecentRequests() give requests number on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard-bagdasaryan committed Nov 21, 2024
1 parent 90aa746 commit b50d546
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1693,9 +1693,8 @@ statSawRecentRequests()
// Math below computes the number of requests during the last 0-6 minutes.
// CountHist is based on "minutes passed since Squid start" periods. It cannot
// deliver precise info for "last N minutes", but we do not need to be precise.
if (NCountHist > recentMinutes)
return statCounter.client_http.requests - CountHist[recentMinutes].client_http.requests;
return 0;
const auto oldRequests = (NCountHist > recentMinutes) ? CountHist[recentMinutes].client_http.requests : 0;
return statCounter.client_http.requests - oldRequests;
}

static double
Expand Down

0 comments on commit b50d546

Please sign in to comment.