Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Nov 2021 16:12:28 GMT
From:      =?utf-8?Q?Stefan E=C3=9Fer?= <se@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 4a7c4e2795b7 - main - sysutils/zpool-iostat-viz: add new port
Message-ID:  <202111061612.1A6GCSAD096826@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by se:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4a7c4e2795b7e3be9a50ea5d323847755ec5acd5

commit 4a7c4e2795b7e3be9a50ea5d323847755ec5acd5
Author:     Stefan Eßer <se@FreeBSD.org>
AuthorDate: 2021-11-06 16:12:13 +0000
Commit:     Stefan Eßer <se@FreeBSD.org>
CommitDate: 2021-11-06 16:12:13 +0000

    sysutils/zpool-iostat-viz: add new port
    
    This port displays ZPOOL latency values in a more intiitive form than
    available from "zpool iostat -r".
    
    I have added some functionality and a man-page, which I'll offer to
    the original author for inclusion in the official version.
---
 sysutils/Makefile                                  |   1 +
 sysutils/zpool-iostat-viz/Makefile                 |  25 +++++
 sysutils/zpool-iostat-viz/distinfo                 |   3 +
 .../zpool-iostat-viz/files/patch-zpool-iostat-viz  |  49 +++++++++
 sysutils/zpool-iostat-viz/files/zpool-iostat-viz.1 | 119 +++++++++++++++++++++
 sysutils/zpool-iostat-viz/pkg-descr                |   8 ++
 6 files changed, 205 insertions(+)

diff --git a/sysutils/Makefile b/sysutils/Makefile
index 5f0229df19b0..381a02c0b427 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -1586,6 +1586,7 @@
     SUBDIR += znapzend
     SUBDIR += zogftw
     SUBDIR += zoxide
+    SUBDIR += zpool-iostat-viz
     SUBDIR += zrep
     SUBDIR += zrepl
     SUBDIR += zsd
diff --git a/sysutils/zpool-iostat-viz/Makefile b/sysutils/zpool-iostat-viz/Makefile
new file mode 100644
index 000000000000..f8c4a71ab7b8
--- /dev/null
+++ b/sysutils/zpool-iostat-viz/Makefile
@@ -0,0 +1,25 @@
+PORTNAME=	zpool-iostat-viz
+DISTVERSION=	3
+CATEGORIES=	sysutils
+
+MAINTAINER=	se@FreeBSD.org
+COMMENT=	ZFS pool I/O latency statistics
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		python:3.4+ shebangfix
+USE_GITHUB=	yes
+GH_ACCOUNT=	chadmiller
+SHEBANG_FILES=	${WRKSRC}/${PORTNAME}
+
+NO_ARCH=	yes
+NO_BUILD=	yes
+
+PLIST_FILES=	bin/${PORTNAME} man/man1/${PORTNAME}.1.gz
+
+do-install:
+		${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
+		${INSTALL_MAN} ${FILESDIR}/${PORTNAME}.1 ${STAGEDIR}${MANPREFIX}/man/man1
+
+.include <bsd.port.mk>
diff --git a/sysutils/zpool-iostat-viz/distinfo b/sysutils/zpool-iostat-viz/distinfo
new file mode 100644
index 000000000000..97d1005795aa
--- /dev/null
+++ b/sysutils/zpool-iostat-viz/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1636200767
+SHA256 (chadmiller-zpool-iostat-viz-3_GH0.tar.gz) = 98d2af36ad5bc5137ccfc2bd1c7394ae38d6f4cd991d99113750b8f2ed252bb2
+SIZE (chadmiller-zpool-iostat-viz-3_GH0.tar.gz) = 276370
diff --git a/sysutils/zpool-iostat-viz/files/patch-zpool-iostat-viz b/sysutils/zpool-iostat-viz/files/patch-zpool-iostat-viz
new file mode 100644
index 000000000000..2e696b6e5f9c
--- /dev/null
+++ b/sysutils/zpool-iostat-viz/files/patch-zpool-iostat-viz
@@ -0,0 +1,49 @@
+--- zpool-iostat-viz.orig	2021-11-06 15:43:57 UTC
++++ zpool-iostat-viz
+@@ -19,7 +19,10 @@ import sys
+ EMPTY_COLORS = (238, 8)
+ EMPTY_CHAR = "|"
+ PALETTES = list(range(start, end+(second-start), second-start) for second, start, end in ((63, 27, 207), (87, 51, 231), (116, 123, 88), (220, 226, 196), (224, 231, 196), (80, 51, 196), (77, 40, 225), (225, 231, 201), (243, 240, 255), (227, 226, 231), (27, 21, 51)))
+-DISPLAY_CHARS = ".abcdefghijklmnopqrstuvwxyz^"
++DISPLAY_CHARS_LETTERS = ".abcdefghijklmnopqrstuvwxyz^"
++DISPLAY_CHARS_DIGITS = ".0123456789#"
++DISPLAY_CHARS_SYMBOLS = " .:;*#"
++DISPLAY_CHARS = DISPLAY_CHARS_LETTERS
+ DIFFL_CLOCK_CHARS = "╷╴╵╶"
+ 
+ DIFFL_STAT_MEMORY = 5
+@@ -219,6 +222,13 @@ def render_stats(window, transform, should_show_differ
+         elif in_key == curses.KEY_DOWN:
+             if diffl_stat_interval_index > 0:
+                 diffl_stat_interval_index -= 1
++        elif in_key == ord('d'):
++            should_show_differential = not should_show_differential
++        elif in_key == ord('m'):
++            if transform == stats_as_device_centric:
++                transform = stats_as_measurement_centric
++            else:
++                transform = stats_as_device_centric
+         elif in_key == ord('q') or in_key == ord('x') or in_key == 27:
+             return
+         current += len(stats)
+@@ -256,6 +266,8 @@ if __name__ == "__main__":
+         arg_parser.add_argument("--pal-count", "--pc", action="store", metavar="P", default="0", help="palette for bucket populations")
+         arg_parser.add_argument("parts", metavar="pool/vdev", nargs="*", help="Pools or vdevs to display")
+         arg_parser.add_argument("--help-colors", action="store_true", help="see color palettes available")
++        arg_parser.add_argument("--digits", action="store_true", help="use digits instead of letters")
++        arg_parser.add_argument("--symbols", action="store_true", help="use digits instead of letters")
+ 
+         parsed_args = vars(arg_parser.parse_args())
+ 
+@@ -276,6 +288,11 @@ if __name__ == "__main__":
+                 print()
+             sys.exit(0)
+ 
++        if parsed_args["digits"]:
++            DISPLAY_CHARS = DISPLAY_CHARS_DIGITS
++        if parsed_args["symbols"]:
++            DISPLAY_CHARS = DISPLAY_CHARS_SYMBOLS
++
+         curses.wrapper(lambda window: main(window, parsed_args["diff"], parsed_args["parts"], parsed_args["file"], parsed_args["by"] or "m"))
+     except subprocess.CalledProcessError as exc:
+         print("I couldn't get your pool information. Make sure you have 'zpool' program and specify your pool correctly.")
diff --git a/sysutils/zpool-iostat-viz/files/zpool-iostat-viz.1 b/sysutils/zpool-iostat-viz/files/zpool-iostat-viz.1
new file mode 100644
index 000000000000..10995be87fb3
--- /dev/null
+++ b/sysutils/zpool-iostat-viz/files/zpool-iostat-viz.1
@@ -0,0 +1,119 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
+.\" Copyright (c) [year] [your name]
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" Note: The date here should be updated whenever a non-trivial
+.\" change is made to the manual page.
+.Dd November, 6 2021
+.Dt ZPOOL-IOSTAT-VIZ 1
+.Os
+.Sh NAME
+.Nm zpool-iostat-viz
+.Nd Display ZFS pool latency histogram
+.Sh SYNOPSIS
+.Nm
+.Op Fl d , -diff
+.Op Fl -by Ar d|m
+.Op Fl f Ar file , Fl -from-file Ar file
+.Op Fl -pt Ar palette , Fl -pal-time Ar palette
+.Op Fl -pc Ar palette , Fl -pal-count Ar palette
+.Op Fl -digits
+.Op Fl -symbols
+.Op Fl -help-colors
+.Op Ar parts ...
+.Sh DESCRIPTION
+The
+.Nm
+command displays ZFS pool latency information in a more intuitive format
+than the
+.Xr zpool 8
+command invoked as
+.Dq zpool -r .
+Latency information is displayed in a matrix with shorter latency times
+at the top, longer times at the bottom, and columns for the selected
+pools or devices the pools consist of.
+.Pp
+.Bl -tag -width "--help-colors"
+.It Fl -by Ar d|m
+Slice data by device
+.Pq Fl -by Ar d
+or by measurement
+.Pq Fl -by Ar m .
+Use the left and right arrow keys on your keyboard to select one of the
+available screens.
+.It Fl d , -diff
+Show histogram for 3 seconds intervals instead of counts cumulated
+over the run-time of the program.
+The sampling period can be adjusted with the up and down arrow keys.
+.It Fl -digits
+Use
+.Dq ".0123456789#"
+as histogram values.
+.It Fl -from-file Ar file
+Read values from a file containing the output of:
+
+.Dl zpool iostat -wvHp
+.It Fl -help-colors
+List the available color palettes for the
+.Fl -pc
+and
+.Fl -pt
+options.
+.It Fl -pt Ar palette , Fl -pal-time Ar palette
+Select a color palette for the display of time buckets.
+.It Fl -pc Ar palette , Fl -pal-count Ar palette
+Select a color palette for the display of bucket populationss.
+.It Fl -symbols
+Use
+.Dq " .:;*#"
+as histogram values.
+.It Ar parts
+Select parts or vdevs to display.
+By default, all devices
+.Pq including cache and ZIL devices ,
+the logical elements the pools consists of
+.Pq mirror, raidz1, ...
+and all pools are displayed.
+.El
+.Sh EXIT STATUS
+The
+.Nm
+program always returns an exit status of 0.
+.Sh EXAMPLES
+The following is an example of a typical usage
+of the
+.Nm
+command:
+.Pp
+.Dl "zpool-iostats-viz -d"
+.Pp
+.Dl "zpool-iostats-viz --by d --symbols tank"
+.Sh SEE ALSO
+.Xr zpool 8
+.Sh AUTHORS
+The
+.Nm
+program was written by
+.An Chad Miller Aq Mt chad@cornsilk.net .
diff --git a/sysutils/zpool-iostat-viz/pkg-descr b/sysutils/zpool-iostat-viz/pkg-descr
new file mode 100644
index 000000000000..6809bee42bb6
--- /dev/null
+++ b/sysutils/zpool-iostat-viz/pkg-descr
@@ -0,0 +1,8 @@
+This tool displays ZFS pool latency histogram in a way that should
+be more intuitive than the numbers output by "zpool iostat -r".
+
+Letters from "." over "a" to "z" and finally "^" are displayed for
+higher numbers of latencies observed either over the run-time of
+the program or within each 3 second interval.
+
+WWW: https://github.com/chadmiller/zpool-iostat-viz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111061612.1A6GCSAD096826>