]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/pg_autoscaler: include pg_autoscale_bias in autoscale-status table
authorSage Weil <sage@redhat.com>
Mon, 25 Mar 2019 11:29:53 +0000 (06:29 -0500)
committerSage Weil <sage@redhat.com>
Thu, 4 Apr 2019 22:05:16 +0000 (17:05 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit f1d3be6ac7a9e5092a5a610ac3f5a59c74e25bc7)

src/pybind/mgr/pg_autoscaler/module.py

index e92377eb4bdbbb8e86e11b8128e55a2920389224..2a1cf978c4afabdccf5c89b3eb56e382829ddd74 100644 (file)
@@ -109,6 +109,7 @@ class PgAutoscaler(MgrModule):
             table = PrettyTable(['POOL', 'SIZE', 'TARGET SIZE',
                                  'RATE', 'RAW CAPACITY',
                                  'RATIO', 'TARGET RATIO',
+                                 'BIAS',
                                  'PG_NUM',
 #                                 'IDEAL',
                                  'NEW PG_NUM', 'AUTOSCALE'],
@@ -120,6 +121,7 @@ class PgAutoscaler(MgrModule):
             table.align['RAW CAPACITY'] = 'r'
             table.align['RATIO'] = 'r'
             table.align['TARGET RATIO'] = 'r'
+            table.align['BIAS'] = 'r'
             table.align['PG_NUM'] = 'r'
 #            table.align['IDEAL'] = 'r'
             table.align['NEW PG_NUM'] = 'r'
@@ -145,6 +147,7 @@ class PgAutoscaler(MgrModule):
                     mgr_util.format_bytes(p['subtree_capacity'], 6),
                     '%.4f' % p['capacity_ratio'],
                     tr,
+                    p['bias'],
                     p['pg_num_target'],
 #                    p['pg_num_ideal'],
                     final,
@@ -318,6 +321,7 @@ class PgAutoscaler(MgrModule):
                 'pg_num_ideal': int(pool_pg_target),
                 'pg_num_final': final_pg_target,
                 'would_adjust': adjust,
+                'bias': p.get('options', {}).get('pg_autoscale_bias', 1.0),
                 });
 
         return (ret, root_map, pool_root)