From nobody Sun Aug 11 19:31:31 2024 X-Original-To: dev-commits-src-all@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 4Whnnw0kMpz5TVLQ; Sun, 11 Aug 2024 19:31:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Whnnv3mw2z4Xvh; Sun, 11 Aug 2024 19:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723404691; 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; bh=JsyQx3OIQT4+HOnSZkjnYodW92HOZcfO8EutI1Z1ajw=; b=efs0u8rY61jGakFyAPV+xiuZ6y6y47Yauh0TzF8GfuZGxrONEe6Oexq6gQuvTNZD3T6mBP swsrS+FzcKKCryDGu2LKrgXvOB3TUuzTv/eM+mJUDNnfSInGMMHVqRlq7OgTO7zIBfDQls DnyijdbxS4e0CW4lCSgfRkE1XwS/H4M1ImqKSlDR3SV93wifbeAiP/FMju+w46BKsZUYQk BDPNmSkXQo7CVIDloCXFL/yAJIl1wn1drj37sunMRJnHgF/2PmOsgkq5cnK6+12RKcM0eI Z7Zg/dvZbldqnI2VGFGTSh05sQ3ymtvHks8SeYz4FiNbFiSATkcNJVKTiGY1+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723404691; a=rsa-sha256; cv=none; b=LLPpaUszh96eb/1976L9j0KhqWtvpnK+2ZKQrA0T899Xr8c/dXTF98wl0N/LB0r72aRcr/ KfApm9HixfKso3zwUu8EFjbh4RM9XrM3bZmWwvf47j1ehI8hD3hlkGi5eCEt/r+oTWubSa Dn4OUJPn0MlqcfcvrII+SUBoZLIQseLmhWNpif3410huJAuH6bE+LK/Xhv0Zhlwx0ZsnXZ ExJEb6Jm2NK89cfhIJa3MajVXuGRruN9gxvmq2u6aE98Iik1E8xDhvcHC4GxR9nGk+StNa IRg7I+wJDRv1GRKeKcQ6VquBLV2ABUbO/fX904aeMJcHEq/rQKD938ZOf6oqWA== 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=1723404691; 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; bh=JsyQx3OIQT4+HOnSZkjnYodW92HOZcfO8EutI1Z1ajw=; b=ib9u19utL3pi/z/DiflBG37h4IZwJBTrIUeolA/vqneoALM5WlI6+LNyI6Xdu9u/LR5Szt Qb073EvcK+QEs9mFJRgGXQ47MhbrCFZKSmNjBLasCahELww/4KEoPmVexBJyC8/CuSl+f4 EcdGFjQdflq+C4zbkYFu6UDiTpt7UkYu03Y98Ots8ZcFLwdgkTVnhSA3wj5f/V8Ar5YXQs RgAG47wEtKgjwFDqctS5eiBoPtSD96AFavUsU03nwmCYx7bnH05MxqtIL7fYDbavCFLQ5V HKSk1IvOXj7yccBYoPhWCcvU4KCIXVBpWZymAnkcgNx9R/+vQAxuS9at5mAc9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Whnnv3NTHzwZb; Sun, 11 Aug 2024 19:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47BJVVvT072531; Sun, 11 Aug 2024 19:31:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47BJVVT0072528; Sun, 11 Aug 2024 19:31:31 GMT (envelope-from git) Date: Sun, 11 Aug 2024 19:31:31 GMT Message-Id: <202408111931.47BJVVT0072528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Zhilin Subject: git: d81b0f5e43f0 - stable/13 - usr.sbin/gstat: add microsecond precision for disk latency List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mizhka X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d81b0f5e43f0778f8c44a2d5ef2ac211362d8dd0 Auto-Submitted: auto-generated The branch stable/13 has been updated by mizhka: URL: https://cgit.FreeBSD.org/src/commit/?id=d81b0f5e43f0778f8c44a2d5ef2ac211362d8dd0 commit d81b0f5e43f0778f8c44a2d5ef2ac211362d8dd0 Author: Michael Zhilin AuthorDate: 2024-08-04 08:31:06 +0000 Commit: Michael Zhilin CommitDate: 2024-08-11 19:31:13 +0000 usr.sbin/gstat: add microsecond precision for disk latency This patch makes gstat to show latency in microseconds if actual latency is less than 1ms. It affects only "ms/r" and "ms/w" columns. Before patch: L(q) ops/s r/s kBps ms/r w/s kBps ms/w %busy Name 0 922 0 0 0.0 922 35809 0.0 2.8| nda0 0 928 2 34 0.1 926 35809 0.0 3.1| nda1 After patch: L(q) ops/s r/s kBps ms/r w/s kBps ms/w %busy Name 0 496 1 31 0.156 495 16020 0.040 1.5| nda0 0 492 0 0 0.000 492 16020 0.042 1.5| nda1 Reviewed by: imp Sponsored by: Postgres Professional Differential Revision: https://reviews.freebsd.org/D41999 (cherry picked from commit d471b4f71dd3b09ada5bf58912dfb1266dd47750) --- usr.sbin/gstat/gstat.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/usr.sbin/gstat/gstat.c b/usr.sbin/gstat/gstat.c index 37ca7b18c373..8aee21c6f4f3 100644 --- a/usr.sbin/gstat/gstat.c +++ b/usr.sbin/gstat/gstat.c @@ -406,16 +406,20 @@ main(int argc, char **argv) PRINTMSG(",%.0f", (double)ld[2] * 1024); if (ld[3] > 1e3) PRINTMSG(",%.0f", (double)ld[3]); - else + else if (ld[3] > 1e0) PRINTMSG(",%.1f", (double)ld[3]); + else + PRINTMSG(",%.3f", (double)ld[3]); PRINTMSG(",%.0f", (double)ld[4]); if (flag_s) PRINTMSG(",%.0f", (double)ld[14]); PRINTMSG(",%.0f", (double)ld[5] * 1024); if (ld[6] > 1e3) PRINTMSG(",%.0f", (double)ld[6]); - else + else if (ld[6] > 1e0) PRINTMSG(",%.1f", (double)ld[6]); + else + PRINTMSG(",%.3f", (double)ld[6]); if (flag_d) { PRINTMSG(",%.0f", (double)ld[8]); @@ -426,9 +430,12 @@ main(int argc, char **argv) if (ld[10] > 1e3) PRINTMSG(",%.0f", (double)ld[10]); - else + else if (ld[10] > 1e0) PRINTMSG(",%.1f", (double)ld[10]); + else + PRINTMSG(",%.3f", + (double)ld[10]); } if (flag_o) { @@ -436,8 +443,11 @@ main(int argc, char **argv) if (ld[12] > 1e3) PRINTMSG(",%.0f", (double)ld[12]); + else if (ld[12] > 1e0) + PRINTMSG(",%.1f", + (double)ld[12]); else - PRINTMSG(",%.1f", + PRINTMSG(",%.3f", (double)ld[12]); } PRINTMSG(",%.1lf", (double)ld[7]); @@ -450,16 +460,20 @@ main(int argc, char **argv) PRINTMSG(" %6.0f", (double)ld[2] * 1024); if (ld[3] > 1e3) PRINTMSG(" %6.0f", (double)ld[3]); - else + else if (ld[3] > 1e0) PRINTMSG(" %6.1f", (double)ld[3]); + else + PRINTMSG(" %6.3f", (double)ld[3]); PRINTMSG(" %6.0f", (double)ld[4]); if (flag_s) PRINTMSG(" %6.0f", (double)ld[14]); PRINTMSG(" %6.0f", (double)ld[5] * 1024); if (ld[6] > 1e3) PRINTMSG(" %6.0f", (double)ld[6]); - else + else if (ld[6] > 1e0) PRINTMSG(" %6.1f", (double)ld[6]); + else + PRINTMSG(" %6.3f", (double)ld[6]); if (flag_d) { PRINTMSG(" %6.0f", (double)ld[8]); @@ -471,9 +485,12 @@ main(int argc, char **argv) if (ld[10] > 1e3) PRINTMSG(" %6.0f", (double)ld[10]); - else + else if (ld[10] > 1e0) PRINTMSG(" %6.1f", (double)ld[10]); + else + PRINTMSG(" %6.3f", + (double)ld[10]); } if (flag_o) { @@ -481,8 +498,11 @@ main(int argc, char **argv) if (ld[12] > 1e3) PRINTMSG(" %6.0f", (double)ld[12]); + else if (ld[12] > 1e0) + PRINTMSG(" %6.1f", + (double)ld[12]); else - PRINTMSG(" %6.1f", + PRINTMSG(" %6.3f", (double)ld[12]); }