From 086dc90965c9d2400a3587a62f317de33efccba1 Mon Sep 17 00:00:00 2001 From: Neeraj Pratap Singh Date: Tue, 21 Feb 2023 15:40:13 +0530 Subject: [PATCH] cephfs-top: Handle `METRIC_TYPE_NONE` fields for sorting Currently, the sort feature in cephfs-top isn't applicable to the fields which are of type `METRIC_TYPE_NONE` , named as 'ofiles', 'oicaps' and 'oinodes'. This commit will make the cephfs-top sort feature to support the above mentioned fields too. From this commit onwards, all the current fields displayed in cephfs-top can be used for sorting. Fixes: https://tracker.ceph.com/issues/58814 Signed-off-by: Neeraj Pratap Singh (cherry picked from commit 4626cb5fb1141c38acd4b114ad4562bd14fa7aad) --- src/tools/cephfs/top/cephfs-top | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/cephfs/top/cephfs-top b/src/tools/cephfs/top/cephfs-top index 152dfe9e7f6b3..204e700616cc3 100755 --- a/src/tools/cephfs/top/cephfs-top +++ b/src/tools/cephfs/top/cephfs-top @@ -825,6 +825,7 @@ class FSTop(FSTopBase): xp += len(f'{self.speed_items(item)}{self.speed_mtype(typ)}') + ITEMS_PAD_LEN else: # display 0th element from metric tuple + metrics_dict[fs_name][client_id][self.items(item)] = m[0] self.fsstats.addstr(y_coord, xp, f'{m[0]}', curses.A_DIM) xp += len(f'{self.items(item)}{self.mtype(typ)}') + ITEMS_PAD_LEN else: -- 2.39.5