From nobody Wed Feb 18 18:51:20 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fGQZx2g4cz6Sd5V; Wed, 18 Feb 2026 18:51:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fGQZx20yGz3f8M; Wed, 18 Feb 2026 18:51:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771440681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XNouyp7w01Ftp11bbWRPaKPQbvP3ADj/Ut5DM4Kw3+o=; b=lah6dvuK+VHBTEXnTISZF7sOVpKw3RDDf+TIoUi6ZRvBGZttDWhX2BBGWuI9HV0o5PA8lm ohkdIyfThEnMFTaqfPgiUxXmJriJNIWBm7GUpPyGAiiwFTe/Vn/yJ92LQIfPDRqpyvEKIw yTVJOv3bjaXAZzxVS38t5c9sDwFeWbJHDx0spWplRbJraocHJlIhUCE467SGn6k0fJBFZT X/zfoWgLTmvUDtu87VS98scjZTUCHWWatq/gi9LOFOzES8zrlbsZNYqIFAjhFiQcuiXOUF kz2VHKJeCwjvNpXjOCcESX40qHNhvxQvIKbMNGO3csH1xb/D9SccEXwO8E6Njw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771440681; a=rsa-sha256; cv=none; b=JeqnCPw3nMQGvnKIFBsu/kA8ijlI5BzFtiCYLUZ/6QemfD8VKwhpe7JZlg4Juw2ckvrbO4 /CMB6EicVliqoZddttuG1uuPdS4yE8W09U8aRoEniocsBqYZwJ1YTUGKhL0fPePylsOpUq I+0Q1hedHqVN0+O+lmVi6ZJaYjon4L01gvlSepeErtgJk4UWsVDtNh8TrrLqxm+xKmpUuQ OtIELONIPaubrH0mT8GGcJ7cTPSObsyPLmCPhlWP4jV0/45GZAxlP1eHLD9R24MAxut9uk ZId8T251hqQs7yrL8hVEJF5sKvsObaXgBigaZ+EGFmNC4/IxopXUSIYzglHV7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771440681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XNouyp7w01Ftp11bbWRPaKPQbvP3ADj/Ut5DM4Kw3+o=; b=PaVNthRpC1PSyXiij/kwLAvrINo8lIBDI4XmA7h7ZnEIL2mPisYiipbO5g0dqTXH4V/s4m o2ohSDjmH8PO46uC7fyNtKUWK292/mtbz6phYfNhwZXt4BExRPbQErSHYD6XpJcGogp6ER M2MHg12JztTx6D/OF9+VTpGmT/ke2nUrrSDxSu8UK31P5V18VczuBLw/L9HM+raXPB63Pm +Uyo/0Y4d0kIst6SIc3HjIyWwJp4cu7gz7D0zdbRNpsfAqYBZ0/ZfxYStlGscMSReypBwj pvzT4F7gGRdMtXoc1MZYS1cusEcvCXwycL0VODJ/SO3UONF4g8S6iPwVrzuhaA== Received: from [IPV6:2601:5c0:4202:5670:893d:f408:267e:3b85] (unknown [IPv6:2601:5c0:4202:5670:893d:f408:267e:3b85]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fGQZw75WgztGB; Wed, 18 Feb 2026 18:51:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <06f7c9c0-a681-4573-8b1d-83b65f825d5b@FreeBSD.org> Date: Wed, 18 Feb 2026 13:51:20 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 8e593a1f1432 - main - fortune: fix netstat tip Content-Language: en-US To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <6995eeee.37508.1de1224c@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <6995eeee.37508.1de1224c@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/18/26 11:55, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=8e593a1f143203cace2e14bd6629a8ebdf9b47dc > > commit 8e593a1f143203cace2e14bd6629a8ebdf9b47dc > Author: Warner Losh > AuthorDate: 2026-02-10 14:59:58 +0000 > Commit: Warner Losh > CommitDate: 2026-02-18 16:39:28 +0000 > > fortune: fix netstat tip > > netstati 8 reports in bytes per second (averaged over 8 > seconds) rather than bits per second because it reports the total > in bits over the 8 seconds... > > Sponsored by: Netflix Eh, I originally thought this too, but the original hint is right. netstat doesn't report a per-second average, just the delta, so when using '8' it is showing the number of bytes sent/received in the 8 second interval which effectively multiplies the per-second rate by 8, so if it is a constant rate you get the bits-per-second as the output. Relevant code from sidewaysintpr() in if.c: fill_iftot(new); xo_open_instance("stats"); show_stat("lu", 10, "received-packets", new->ift_ip - old->ift_ip, 1, 1); show_stat("lu", 5, "received-errors", new->ift_ie - old->ift_ie, 1, 1); show_stat("lu", 5, "dropped-packets", new->ift_id - old->ift_id, 1, 1); show_stat("lu", 10, "received-bytes", new->ift_ib - old->ift_ib, 1, 0); show_stat("lu", 10, "sent-packets", new->ift_op - old->ift_op, 1, 1); show_stat("lu", 5, "send-errors", new->ift_oe - old->ift_oe, 1, 1); show_stat("lu", 10, "sent-bytes", new->ift_ob - old->ift_ob, 1, 0); show_stat("NRSlu", 5, "collisions", new->ift_co - old->ift_co, 1, 1); if (dflag) show_stat("LSlu", 5, "dropped-packets", new->ift_od - old->ift_od, 1, 1); xo_close_instance("stats"); xo_emit("\n"); xo_flush(); (Note no scaling, just 'new - old') -- John Baldwin