]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-top: Handle `METRIC_TYPE_NONE` fields for sorting 50595/head
authorNeeraj Pratap Singh <Neeraj.Pratap.Singh1@ibm.com>
Tue, 21 Feb 2023 10:10:13 +0000 (15:40 +0530)
committerneeraj pratap singh <neerajpratapsingh@li-ff7f0d4c-3462-11b2-a85c-d4004c0fa1a0.ibm.com>
Wed, 14 Jun 2023 12:14:20 +0000 (17:44 +0530)
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 <neesingh@redhat.com>
(cherry picked from commit 4626cb5fb1141c38acd4b114ad4562bd14fa7aad)

src/tools/cephfs/top/cephfs-top

index 68d1c6cac86511073c260b4bcdff038d6de234c8..60c603d6c3e45353d51f104f7de0f22e8219c00f 100755 (executable)
@@ -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: