summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-08-17 09:38:17 +0200
committerMartin Liska <mliska@suse.cz>2022-08-17 14:50:10 +0200
commitc1feb2717ff72adc963360e00ce70a9ed2d8e613 (patch)
tree01c15e9e6ff19112178d768c8da53c8c40a4bd93
parent9db6b94541623ad9e76cb3c84e132a110b54b0f7 (diff)
downloadelfutils-c1feb2717ff72adc963360e00ce70a9ed2d8e613.tar.gz
debuginfod: fix http_requests_total{type="debuginfo"} when dwz is used
When dwarf_extract_source_paths is called, it can call handle_buildid when a rpm file used dwz. Ignore such internal request in http_requests_total statistics. Signed-off-by: Martin Liska <mliska@suse.cz>
-rw-r--r--debuginfod/debuginfod.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index 366a4a09..3e2dd9ef 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -1921,7 +1921,8 @@ handle_buildid (MHD_Connection* conn,
throw reportable_exception("invalid artifacttype");
}
- inc_metric("http_requests_total", "type", artifacttype);
+ if (conn != 0)
+ inc_metric("http_requests_total", "type", artifacttype);
if (atype_code == "S" && suffix == "")
throw reportable_exception("invalid source suffix");
@@ -2083,7 +2084,8 @@ and will not query the upstream servers");
if (fd >= 0)
{
- inc_metric ("http_responses_total","result","upstream");
+ if (conn != 0)
+ inc_metric ("http_responses_total","result","upstream");
struct stat s;
int rc = fstat (fd, &s);
if (rc == 0)