summaryrefslogtreecommitdiff
path: root/sysutils/zpool-iostat-viz/files/patch-zpool-iostat-viz
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/zpool-iostat-viz/files/patch-zpool-iostat-viz')
-rw-r--r--sysutils/zpool-iostat-viz/files/patch-zpool-iostat-viz49
1 files changed, 49 insertions, 0 deletions
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.")