From: Neeraj Pratap Singh Date: Tue, 21 Feb 2023 10:10:13 +0000 (+0530) Subject: cephfs-top: Handle `METRIC_TYPE_NONE` fields for sorting X-Git-Tag: v17.2.7~242^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0ca441c0f96c6bd1a6dae2dff00671a3457839cc;p=ceph.git 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) --- diff --git a/src/tools/cephfs/top/cephfs-top b/src/tools/cephfs/top/cephfs-top index 68d1c6cac865..60c603d6c3e4 100755 --- a/src/tools/cephfs/top/cephfs-top +++ b/src/tools/cephfs/top/cephfs-top @@ -800,6 +800,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: