Skip to content

Commit ff551d2

Browse files
committed
logstats: be more strict with filtering out requests status codes
We want to count every attempt of pacman to fetch something only once. So for the repo, 200 and 206 (does that count?) and 304. For mirrorbits 302 when a redirect to a mirror happens and 304.
1 parent c1542af commit ff551d2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

msys2-logstats

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,15 @@ def main(argv):
361361
decoded["time"],
362362
None,
363363
)
364-
if entry.RequestHost not in ["repo.msys2.org", "mirror.msys2.org"]:
365-
continue
366364
if entry.RequestMethod != "GET":
367365
continue
368-
if not entry.DownstreamStatus < 400:
366+
if entry.RequestHost == "repo.msys2.org":
367+
if entry.DownstreamStatus not in [200, 206, 304]:
368+
continue
369+
elif entry.RequestHost == "mirror.msys2.org":
370+
if entry.DownstreamStatus not in [302, 304]:
371+
continue
372+
else:
369373
continue
370374
if not is_valid_user_agent(entry.UserAgent):
371375
continue

0 commit comments

Comments
 (0)