From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2E9wOod5T2CvagAA0tVLHw (envelope-from ) for ; Mon, 15 Mar 2021 15:13:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YG0zNod5T2CCbwAAB5/wlQ (envelope-from ) for ; Mon, 15 Mar 2021 15:13:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 719E426DCF for ; Mon, 15 Mar 2021 16:13:11 +0100 (CET) Received: from localhost ([::1]:36626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLou6-00007Q-IL for larch@yhetil.org; Mon, 15 Mar 2021 11:13:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLoty-00006u-Hh for guix-patches@gnu.org; Mon, 15 Mar 2021 11:13:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLoty-0006Iv-9j for guix-patches@gnu.org; Mon, 15 Mar 2021 11:13:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lLoty-0005s5-4H for guix-patches@gnu.org; Mon, 15 Mar 2021 11:13:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47158] [PATCH 2/2] scripts: weather: Provide more representative request statistics. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Mar 2021 15:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47158 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47158@debbugs.gnu.org Received: via spool by 47158-submit@debbugs.gnu.org id=B47158.161582118122557 (code B ref 47158); Mon, 15 Mar 2021 15:13:02 +0000 Received: (at 47158) by debbugs.gnu.org; 15 Mar 2021 15:13:01 +0000 Received: from localhost ([127.0.0.1]:36369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lLotw-0005rl-Qx for submit@debbugs.gnu.org; Mon, 15 Mar 2021 11:13:01 -0400 Received: from mira.cbaines.net ([212.71.252.8]:60384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lLotu-0005rd-PC for 47158@debbugs.gnu.org; Mon, 15 Mar 2021 11:12:59 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id EBFF527BC54 for <47158@debbugs.gnu.org>; Mon, 15 Mar 2021 15:12:57 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 6cc48d4a for <47158@debbugs.gnu.org>; Mon, 15 Mar 2021 15:12:57 +0000 (UTC) From: Christopher Baines Date: Mon, 15 Mar 2021 15:12:57 +0000 Message-Id: <20210315151257.17384-2-mail@cbaines.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315151257.17384-1-mail@cbaines.net> References: <20210315151257.17384-1-mail@cbaines.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615821191; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=vtpw/zeO4un/qsO5xnxzAe7BTE/DpTxmkP07igPKPVo=; b=cy0+XWyXE3tQsp63sk9ncPP1GgTFsoHRW1rwyR90Cf1RFoMKER6fZ2goNz8bvy1PMNKGEJ qVzHq6/UyGmxS5m2O6HT4SLg3gYhAa88VSJ4W1DLO0Wvi1qL6wZKF37XqGn8UOZMPATNNo R613wiHq6MXEDzClatYNE47OU5RSrRjY6bZoMWojoXFre/1ZwswEIKIMS1wZco/QqiXYjO o64o4usbVxvfj8jClLMmZIingUFdq7pz8T1n5nWVPtnPoBpMubs09yDIll5639+yRGFOB6 sko1w0dZ/3hlgBizo1NNF9jzzpdCwFWhVrrWf7adOSVcX/VfV+7IbFnJS3HkVA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615821191; a=rsa-sha256; cv=none; b=B+mwIJPeyFn23mKUeQmvXjjDCqBWRp2JVogOjCGOl2L81JonM+wqetodQzfqVjsQ/tL2lo /mrruIh5sw8NS89occqkFCs0FxX+gr8Gr6AxSyP/TbWfHfjDRW40jIZRAg7pVgBXRFjV0B +5rwMBuR2QsNnK6m9vogMFzCVdMPWMR008MJ7jujsfwXcoE4+/VsYQk0ZxEMhg7QfFZ2C2 8JXMnDOBEfU2WY240jmnq/+wEvS3DQW5IGjNkFBaDCYAA0hDqw1o6/QVikSyaDBeac+CmH xo/bjaGR5E/ROZyf9jZBZN2/eHTkmWac+S1TroQoK+k4QRxuugFjRqqpGPxbqw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 4.10 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 719E426DCF X-Spam-Score: 4.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: bhqB+Xu+wc4r Previously, the "seconds per request" and "requests per second" statistics really reported (cache lookups + requests) per second. By looking at the actual number of requests made within lookup-narinfos, a more representative value can be reported. * guix/scripts/weather.scm (let/time): Allow for multiple return values. (report-server-coverage): Alter the reporting of request statistics. --- guix/scripts/weather.scm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm index 26ec543211..349052459c 100644 --- a/guix/scripts/weather.scm +++ b/guix/scripts/weather.scm @@ -117,8 +117,8 @@ values." (end (current-time time-monotonic))) (apply kont (time-difference end start) result))) -(define-syntax-rule (let/time ((time result exp)) body ...) - (call-with-time (lambda () exp) (lambda (time result) body ...))) +(define-syntax-rule (let/time ((time result ... exp)) body ...) + (call-with-time (lambda () exp) (lambda (time result ...) body ...))) (define (histogram field proc seed lst) "Return an alist giving a histogram of all the values of FIELD for elements @@ -181,11 +181,12 @@ Return the coverage ratio, an exact number between 0 and 1." (format #t (G_ "looking for ~h store items on ~a...~%") (length items) server) - (let/time ((time narinfos (lookup-narinfos - server items - #:make-progress-reporter - (lambda* (total #:key url #:allow-other-keys) - (progress-reporter/bar total))))) + (let/time ((time narinfos requests-made + (lookup-narinfos + server items + #:make-progress-reporter + (lambda* (total #:key url #:allow-other-keys) + (progress-reporter/bar total))))) (format #t "~a~%" server) (let ((obtained (length narinfos)) (requested (length items)) @@ -212,9 +213,9 @@ Return the coverage ratio, an exact number between 0 and 1." (format #t (G_ " ~,1h MiB on disk (uncompressed)~%") (/ (reduce + 0 (map narinfo-size narinfos)) MiB)) (format #t (G_ " ~,3h seconds per request (~,1h seconds in total)~%") - (/ time requested 1.) time) + (/ time requests-made 1.) time) (format #t (G_ " ~,1h requests per second~%") - (/ requested time 1.)) + (/ requests-made time 1.)) (guard (c ((http-get-error? c) (if (= 404 (http-get-error-code c)) -- 2.30.1