From 7d2deda2b212a4b5c1b81737321fb4ac2ef10347 Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Thu, 27 Oct 2022 12:12:41 +0530 Subject: [PATCH] cephfs-top: add version in header Signed-off-by: Jos Collin --- src/tools/cephfs/top/cephfs-top | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tools/cephfs/top/cephfs-top b/src/tools/cephfs/top/cephfs-top index 63744ea75611a..27c0f0118e0a2 100755 --- a/src/tools/cephfs/top/cephfs-top +++ b/src/tools/cephfs/top/cephfs-top @@ -40,7 +40,7 @@ FS_TOP_ALL_FS_APP = 'ALL_FS_APP' FS_TOP_FS_SELECTED_APP = 'SELECTED_FS_APP' # version match b/w fstop and stats emitted by mgr/stats -FS_TOP_SUPPORTED_VER = 2 +FS_TOP_SUPPORTED_VER = 2.0 ITEMS_PAD_LEN = 3 ITEMS_PAD = " " * ITEMS_PAD_LEN @@ -85,7 +85,7 @@ MAIN_WINDOW_TOP_LINE_METRICS = OrderedDict([ ]) MGR_STATS_COUNTERS = list(MAIN_WINDOW_TOP_LINE_METRICS.keys()) -FS_TOP_VERSION_HEADER_FMT = '{prog_name} - {now}' +FS_TOP_VERSION_HEADER_FMT = '{prog_name} v{version} - {now}' FS_TOP_CLIENT_HEADER_FMT = 'Total Client(s): {num_clients} - '\ '{num_mounts} FUSE, {num_kclients} kclient, {num_libs} libcephfs' FS_TOP_NAME_TOPL_FMT = 'Filesystem: {fs_name} - {client_count} client(s)' @@ -805,6 +805,7 @@ class FSTop(object): num_libs = num_clients - (num_mounts + num_kclients) now = datetime.now().ctime() self.header.addstr(0, 0, FS_TOP_VERSION_HEADER_FMT.format(prog_name=FS_TOP_PROG_STR, + version=FS_TOP_SUPPORTED_VER, now=now), curses.A_BOLD) self.header.addstr(2, 0, screen_title, curses.color_pair(color_id) | curses.A_BOLD) self.header.addstr(3, 0, FS_TOP_CLIENT_HEADER_FMT.format(num_clients=num_clients, -- 2.39.5