From 79e69073a5789470ca2aa0bc17a94dd60936b04c Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Sep 12 2022 10:29:14 +0000 Subject: backend: ignore downloaded SRPM files Otherwise we count each SRPM that DistGit downloads from backend, and that inflates the stats of project RPMs downloaded. We could specify User-Agent on DistGit and ignore it in the hitcounter script but we agreed that we can ignore SRPM downloads altogether. --- diff --git a/backend/copr_backend/hitcounter.py b/backend/copr_backend/hitcounter.py index 0222462..bfe9341 100644 --- a/backend/copr_backend/hitcounter.py +++ b/backend/copr_backend/hitcounter.py @@ -141,6 +141,12 @@ def get_hit_data(accesses, log): log.debug("Skipping: %s", url) continue + if any(x for x in key_strings + if x.startswith("chroot_rpms_dl_stat|") + and x.endswith("|srpm-builds")): + log.debug("Skipping %s (SRPM build)", url) + continue + log.debug("Processing: %s", url) # When counting RPM access, we want to iterate both project hits and