From nobody Thu Nov 13 10:28:57 2025 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 4d6c21741Gz6GdPQ; Thu, 13 Nov 2025 10:28:57 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d6c216Vj4z3YWK; Thu, 13 Nov 2025 10:28:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763029737; 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=1MQZTC1bcpz+oRKRBCpj+eelJ2vulatoyYDcZuMmcOE=; b=kjWy3qqQQzgTcxexlSGyuaKgtE9z0xEmw2gfZSj7GptF43+S2LjwvQ0AmslQHJ3G+ZDnPV /6c40aB6veiTK6aOv8JQNYtjgHYuAKD+r1q/FVQ4X3ntBYn1q4dgLtgcrOpQatcAx6v1HB jlfBv46jd1ebIo3plF2KbuTgOk8os+WMlgY0zS1Mo8huAlGQK7J3smsyFUDJ2IBqn30Wy4 GKyq9D7Y5Gz36ip3opSRDlV1Xoso5eJPvMvvHzyJutvFkaGCI6c/EXZlK9vhQo6e8ebL1o yiylJd60OMlceIvBs/OkkdKjCrvfZoMCPffnZGEZEIA/trlLQS5wSF6ZHLQHQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763029737; 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=1MQZTC1bcpz+oRKRBCpj+eelJ2vulatoyYDcZuMmcOE=; b=L7wcqWe4dDO7pur81246sXUlmVRy9i/6Cwq1TWvYbrEVH9yzBZZQvMpK6kXmzQbZ1n4Z/u pN2XUztf+JHact22QNc1IS3slU+yER1bfi/yz+JoMNXNnELwnvIMjPJwPvB5owg+YICx41 lmHuPnMni/E2IyFEuHyhSuECImpqisOTAJyCBRzcUBAhcL641kprcZmII8SVA8L61YLOHr vcdGMG1HSjLJABGbTNBTL0gx4Gs3mdgj8jQwPJdB1GvllOng+RZLR4oeootYb2E1pvvpIk etIQLYMTkkk9MLNhs4aDlvoUe2sSYnwz92dO2n1coI7x5LM5v2VvN0otsHlozQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763029737; a=rsa-sha256; cv=none; b=nIk1hbyxtnerlSoxjne1OtB9qZkV1ZfVkUjO7QX5nmlfyc+d1lsXv/ubJO8y/fDx3K82lh jpykI2M4HF3PvmwKgL9tvniYFSc+ZC9l4E0D+t8+Kbg3NGsNn8pSg0po4h7EVeDMlOCr13 cXd4OIpvZAehOsAdVY1cUbR8ovy/9hp+Z+T2NZILTIQUvJ24nKGMiVwW1hrTjdnX+pkbZi cD4JVh/3S18Elo+e9bstHU8l9rTfetiykr+c4hWs3SEnWJWS5en0bdvCl7iI4a4mLDsIod 1uY9BIGaNzE663IyAYjbkyN/5cmJhAc45Er2WvhSTaNTxLLOowCfKwL8epreTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4d6c215s3dz29N; Thu, 13 Nov 2025 10:28:57 +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 5ADASvCN074805; Thu, 13 Nov 2025 10:28:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5ADASvJ4074802; Thu, 13 Nov 2025 10:28:57 GMT (envelope-from git) Date: Thu, 13 Nov 2025 10:28:57 GMT Message-Id: <202511131028.5ADASvJ4074802@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 9d17b61b2fd2 - main - ministat: Clean up usage message, manual page, and chameleon 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d17b61b2fd254b418f3dd6b7a64afbc861a57f8 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=9d17b61b2fd254b418f3dd6b7a64afbc861a57f8 commit 9d17b61b2fd254b418f3dd6b7a64afbc861a57f8 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-11-12 15:06:06 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-11-13 10:27:23 +0000 ministat: Clean up usage message, manual page, and chameleon In the manual page: - Fix synopsis and use better argument names - Improve description of flags. - In EXAMPLES, list the contents of iguana and chameleon files. - Use Rs to reference The Cartoon Guide to Statistics - Fix misc indentation and style issues - Tag SPDX MFC after: 1 week Reviewed by: bcr, ziaee Differential Revision: https://reviews.freebsd.org/D53710 --- usr.bin/ministat/chameleon | 2 +- usr.bin/ministat/ministat.1 | 146 +++++++++++++++++++++++++++++--------------- usr.bin/ministat/ministat.c | 2 +- 3 files changed, 98 insertions(+), 52 deletions(-) diff --git a/usr.bin/ministat/chameleon b/usr.bin/ministat/chameleon index ed1bfdbc4773..dfb1923c000f 100644 --- a/usr.bin/ministat/chameleon +++ b/usr.bin/ministat/chameleon @@ -1,5 +1,5 @@ 150 400 -720 +720 500 930 diff --git a/usr.bin/ministat/ministat.1 b/usr.bin/ministat/ministat.1 index cef7caa7b9d9..437fd66a1ddc 100644 --- a/usr.bin/ministat/ministat.1 +++ b/usr.bin/ministat/ministat.1 @@ -1,6 +1,7 @@ .\" -.\" Copyright (c) 2007 Poul-Henning Kamp -.\" All rights reserved. +.\" Copyright (c) 2007 Poul-Henning Kamp. All rights reserved. +.\" +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 10, 2012 +.Dd November 13, 2025 .Dt MINISTAT 1 .Os .Sh NAME @@ -33,9 +34,9 @@ .Nm .Op Fl Anqs .Op Fl C Ar column -.Op Fl c Ar confidence_level -.Op Fl d Ar delimiter -.Op Fl w Op width +.Op Fl c Ar confidence +.Op Fl d Ar delimiters +.Op Fl w Ar width .Op Ar .Sh DESCRIPTION The @@ -44,10 +45,26 @@ command calculates fundamental statistical properties of numeric data in the specified files or, if no file is specified, standard input. .Pp The options are as follows: -.Bl -tag -width Fl +.Bl -tag -width "-c confidence" .It Fl A Just report the statistics of the input and relative comparisons, suppress the ASCII-art plot. +.It Fl C Ar column +Specify which column of data to use. +By default the first column in the input file(s) is used. +.It Fl c Ar confidence +Specify desired confidence level for Student's T analysis. +Possible percent values are +.Cm 80 , 90 , 95 , 98 , 99 , +and +.Cm 99.5 . +.It Fl d Ar delimiters +Specify the column delimiter characters, default is +.Ql \ \et +.Pq i.e., a space and a tab . +See +.Xr strtok 3 +for details. .It Fl n Just report the raw statistics of the input, suppress the ASCII-art plot and the relative comparisons. @@ -58,75 +75,104 @@ alongside .It Fl s Print the average/median/stddev bars on separate lines in the ASCII-art plot, to avoid overlap. -.It Fl C Ar column -Specify which column of data to use. -By default the first column in the input file(s) are used. -.It Fl c Ar confidence_level -Specify desired confidence level for Student's T analysis. -Possible values are 80, 90, 95, 98, 99 and 99.5 % -.It Fl d Ar delimiter -Specifies the column delimiter characters, default is SPACE and TAB. -See -.Xr strtok 3 -for details. .It Fl w Ar width -Width of ASCII-art plot in characters. +Set the width of the ASCII-art plot in characters. The default is the terminal width, or 74 if standard output is not a terminal. .El .Pp +.Nm +accepts up to seven input files. +.Pp +Each dataset must contain at least three values. +.Sh EXIT STATUS +.Ex -std +.Sh EXAMPLES +Let's consider two input files. +The first one will be +.Dq iguana : +.Bd -literal -offset indent +50 +200 +150 +400 +750 +400 +150 +.Ed +.Pp +The second one will be +.Dq chameleon : +.Bd -literal -offset indent +150 +400 +720 +500 +930 +.Ed +.Pp A sample output could look like this: .Bd -literal -offset indent - $ ministat -s -w 60 iguana chameleon - x iguana - + chameleon - +------------------------------------------------------------+ - |x * x * + + x +| - | |________M______A_______________| | - | |________________M__A___________________| | - +------------------------------------------------------------+ - N Min Max Median Avg Stddev - x 7 50 750 200 300 238.04761 - + 5 150 930 500 540 299.08193 - No difference proven at 95.0% confidence +$ ministat -s -w 60 iguana chameleon +x iguana ++ chameleon ++------------------------------------------------------------+ +|x * x * + + x +| +| |________M______A_______________| | +| |________________M__A___________________| | ++------------------------------------------------------------+ + N Min Max Median Avg Stddev +x 7 50 750 200 300 238.04761 ++ 5 150 930 500 540 299.08193 +No difference proven at 95.0% confidence .Ed .Pp If .Nm tells you, as in the example above, that there is no difference -proven at 95% confidence, the two data sets you gave it are for +proven at 95% confidence, the two datasets you gave it are for all statistical purposes identical. .Pp You have the option of lowering your standards by specifying a lower confidence level: .Bd -literal -offset indent - $ ministat -s -w 60 -c 80 iguana chameleon - x iguana - + chameleon - +------------------------------------------------------------+ - |x * x * + + x +| - | |________M______A_______________| | - | |________________M__A___________________| | - +------------------------------------------------------------+ - N Min Max Median Avg Stddev - x 7 50 750 200 300 238.04761 - + 5 150 930 500 540 299.08193 - Difference at 80.0% confidence - 240 +/- 212.215 - 80% +/- 70.7384% - (Student's t, pooled s = 264.159) +$ ministat -s -w 60 -c 80 iguana chameleon +x iguana ++ chameleon ++------------------------------------------------------------+ +|x * x * + + x +| +| |________M______A_______________| | +| |________________M__A___________________| | ++------------------------------------------------------------+ + N Min Max Median Avg Stddev +x 7 50 750 200 300 238.04761 ++ 5 150 930 500 540 299.08193 +Difference at 80.0% confidence + 240 +/- 212.215 + 80% +/- 70.7384% + (Student's t, pooled s = 264.159) .Ed .Pp But a lower standard does not make your data any better, and the example is only included here to show the format of the output when a statistical difference is proven according to Student's T method. .Sh SEE ALSO -Any mathematics text on basic statistics, for instances Larry Gonicks -excellent "Cartoon Guide to Statistics" which supplied the above example. +Any mathematics text on basic statistics, for instance the following book, +which supplied the above example: +.Rs +.%A Larry Gonick +.%A Woollcott Smith +.%B The Cartoon Guide to Statistics +.%D 1993 +.%I HarperPerennial +.%O ISBN 0-06-273102-5 +.Re .Sh HISTORY The .Nm -command was written by Poul-Henning Kamp out of frustration +command was written by +.An Poul-Henning Kamp +out of frustration over all the bogus benchmark claims made by people with no understanding of the importance of uncertainty and statistics. .Pp diff --git a/usr.bin/ministat/ministat.c b/usr.bin/ministat/ministat.c index 6967841a339f..7d3232370121 100644 --- a/usr.bin/ministat/ministat.c +++ b/usr.bin/ministat/ministat.c @@ -530,7 +530,7 @@ usage(char const *whine) fprintf(stderr, "%s\n", whine); fprintf(stderr, - "Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] [-Anqs] [-w width] [file [file ...]]\n"); + "Usage: ministat [-Anqs] [-C column] [-c confidence] [-d delimiter(s)] [-w width] [file ...]]\n"); fprintf(stderr, "\tconfidence = {"); for (i = 0; i < NCONF; i++) { fprintf(stderr, "%s%g%%",