From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 927D8A00C2; Wed, 23 Nov 2022 14:29:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 351A042D95; Wed, 23 Nov 2022 14:29:33 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id AC29D40E5A for ; Wed, 23 Nov 2022 14:29:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669210171; h=from:from:reply-to:subject:subject: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=2MkuBfEQVE5omn1Wf7aQuJK1wcCyrslVpJXAEFT2LKU=; b=JfPPPa0ukn2AXXAOX7XojhB5VFkYrt4J374F77Ksh2fBDC4UbI7+h2XSNh7/vMcGA59x6j ARjwFlQaltYnfQJjTunTQzx9STI6+5MpT6gKqA3UF2sXC916kLH9NVFy5vWyTp/UydEYJk CFVlYgsSYt4QIUEtzuxnkbv2Dl//LBQ= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-457-3mArC-ugOOSwtP5_Dkn-lQ-1; Wed, 23 Nov 2022 08:29:29 -0500 X-MC-Unique: 3mArC-ugOOSwtP5_Dkn-lQ-1 Received: by mail-wr1-f69.google.com with SMTP id j30-20020adfa55e000000b00241b49be1a3so4967348wrb.4 for ; Wed, 23 Nov 2022 05:29:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=2MkuBfEQVE5omn1Wf7aQuJK1wcCyrslVpJXAEFT2LKU=; b=lIWuetNP5fEvp5PlgxSWlh/gAr/TVltRjMMOrcyne1pyjpb1GNQpdDj3VfsuotusNZ hxbW1Dj9a8qTpb9M7l1hf6avl1ArAYFuSEufoslRcag7I9SNXUxdlpcCq6eTngsk03Sp kNp1LCUaSIFAZYTaKDXAo1Lav5LWevNc98A/UN7SlqzIJ8XyFz/3gYiaaksDkrXj0pR2 XUktHPgHQWpDG6REJT/1Aa3Ea5ubYeQn3jdMmALBSTqT+Qxu2jtkE0ZshWfsDBrleONV oYm+l+ymTfUe9iQQANyB2J8TFOVhRZNibMFJZr0vh8XUnedhXX1KUb42lDfvS9C081YF 1sfg== X-Gm-Message-State: ANoB5pkIAAY+XFDiHnRvX6SescogB9c7HbJjg8odPR/BV93wEUzgDekw Bf5LDm0cyH1K2fHagRBsl9GWySf5oU3Po3ATdbwlxDYBrFk50LrvWZXFJ55Mek39DajGnygIy+x bjOQ= X-Received: by 2002:adf:ebc5:0:b0:241:6c90:79e9 with SMTP id v5-20020adfebc5000000b002416c9079e9mr1725750wrn.642.1669210168741; Wed, 23 Nov 2022 05:29:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf7KAxEeN+zht1erTM+lObNwA3FvSZLgTTqqo2/mPseFtQvIitfFPeroLoDbYtAeQ2k9AnO6cA== X-Received: by 2002:adf:ebc5:0:b0:241:6c90:79e9 with SMTP id v5-20020adfebc5000000b002416c9079e9mr1725736wrn.642.1669210168543; Wed, 23 Nov 2022 05:29:28 -0800 (PST) Received: from localhost (2a01cb000f483e0055ae3800781b5cbc.ipv6.abo.wanadoo.fr. [2a01:cb00:f48:3e00:55ae:3800:781b:5cbc]) by smtp.gmail.com with ESMTPSA id j42-20020a05600c1c2a00b003cfb7c02542sm2469891wms.11.2022.11.23.05.29.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Nov 2022 05:29:27 -0800 (PST) Mime-Version: 1.0 Date: Wed, 23 Nov 2022 14:29:27 +0100 Message-Id: Cc: "Bruce Richardson" , "Jerin Jacob" , "Kevin Laatz" , "Konstantin Ananyev" , =?utf-8?q?Mattias_R=C3=B6nnblom?= Subject: Re: [RFC PATCH 2/4] eal: allow applications to report their cpu utilization From: "Robin Jarry" To: =?utf-8?q?Morten_Br=C3=B8rup?= , X-Mailer: aerc/0.13.0-94-ge6bc9300b18d References: <20221123101931.1688238-1-rjarry@redhat.com> <20221123101931.1688238-3-rjarry@redhat.com> <98CBD80474FA8B44BF855DF32C47DC35D874ED@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D874ED@smartserver.smartshare.dk> X-Mimecast-Spam-Score: 1 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Morten, Morten Br=C3=B8rup, Nov 23, 2022 at 12:52: > This patch is based on a "gauge" (i.e. the busyness percentage) and an > "interval" (i.e. the duration the gauge covers). I have to sample this > gauge exactly every interval to collect data for a busyness chart. If > the application's reporting interval is 1 second, I must sample the > gauge every second, or statistical information will be lost. > > Instead, I would prefer the callback to return two counters: > units_passed (e.g. number of cycles since application start) and > units_busy (e.g. number of busy cycles since application start). > > I can sample these at any interval, and calculate the busyness of that > interval as the difference: (units_busy - units_busy_before) > / (units_passed - units_passed_before). > > If needed, I can also sample them at multiple intervals, e.g. every 1, > 5 and 10 minutes, and expose in the "loadavg". > > I can also sample them every millisecond if I need to react quickly to > a sudden increase/drop in busyness. Your proposal makes a lot of sense and it will even be easier to implement for applications. I'll do that for v2. Thanks for the feedback.