From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id E1D823858D37 for ; Wed, 17 Aug 2022 11:54:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E1D823858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 29D36345C6; Wed, 17 Aug 2022 11:54:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1660737292; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wOYPFe5/VR2cSS/aJxojPauwfHv3cVz9pot4UR3/H2o=; b=AUl+WG+WH05I6uiGnF15AU1sYSrAyqN+drrTgP7tCFwWpKf/DxsHFBEP+RnTqGxOrMEhP5 9pgRgw8KiK8jgqnHaZU0S0vOtSe+8o7pDqLEK6mBpBfJf/AIL9kVFszw12AM+1Iev9eZQH Zurp5qMY2D8GhrZ5h/ESRT+cRrOh9u8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1660737292; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wOYPFe5/VR2cSS/aJxojPauwfHv3cVz9pot4UR3/H2o=; b=ssBB2iONli9uSiL1diT7qDdDiMuy5NYCtOBUyElbrwHtWNNTDIylwUQvx/L94P9F9rypWK eOvM1S1cpSg+OBAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1842913A8E; Wed, 17 Aug 2022 11:54:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MRL8BAzX/GIwMAAAMHmgww (envelope-from ); Wed, 17 Aug 2022 11:54:52 +0000 Message-ID: <59784623-d948-15a2-e404-40c21e41f728@suse.cz> Date: Wed, 17 Aug 2022 13:54:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH v2] debuginfod: fix http_requests_total{type="debuginfo"} when dwz is used To: elfutils-devel@sourceware.org References: <20220817114801.GB4328@redhat.com> Content-Language: en-US In-Reply-To: <20220817114801.GB4328@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2022 11:54:54 -0000 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 --- debuginfod/debuginfod.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx index 9245be53..2bfc8af5 100644 --- a/debuginfod/debuginfod.cxx +++ b/debuginfod/debuginfod.cxx @@ -1918,7 +1918,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"); @@ -2080,7 +2081,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) -- 2.37.1