From: Babu Shanmugam Date: Fri, 11 Apr 2014 13:28:50 +0000 (+0000) Subject: Included the total cluster size in components_count object X-Git-Tag: v0.80-rc1~8^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad40356ddb67dd3807d77e1b44e854c2b769ddd6;p=ceph.git Included the total cluster size in components_count object Signed-off-by: Babu Shanmugam --- diff --git a/README.md b/README.md index 55af44f83a6..574d7fdb0fe 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ Run 'ceph-brag -h' to get the usage information of this tool. "cluster_creation_date": "2014-01-16 13:38:41.928551", "uuid": "20679d0e-04b1-4004-8ee9-45ac271510e9", "components_count": { - "num_bytes": 0, + "num_data_bytes": 0, + "num_bytes_total": 1209312904, "num_osds": 1, "num_objects": 0, "num_pgs": 192, diff --git a/client/ceph-brag b/client/ceph-brag index 22b1e153fc0..91981e580da 100755 --- a/client/ceph-brag +++ b/client/ceph-brag @@ -58,7 +58,8 @@ def get_nums(): pgmap = oj['pgmap'] num_pgs = pgmap['num_pgs'] - num_bytes = pgmap['data_bytes'] + num_data_bytes = pgmap['data_bytes'] + num_bytes_total = pgmap['bytes_total'] (rc, o, e) = run_command(['ceph', 'pg', 'dump', 'pools', '-f', 'json-pretty']) if rc is not 0: @@ -74,7 +75,8 @@ def get_nums(): 'num_osds':num_osds, 'num_mdss':num_mdss, 'num_pgs':num_pgs, - 'num_bytes':num_bytes, + 'num_data_bytes':num_data_bytes, + 'num_bytes_total':num_bytes_total, 'num_pools':num_pools, 'num_objects':num_objs} return nums diff --git a/server/ceph_brag/json.py b/server/ceph_brag/json.py index bc4670287f2..7f36eb6d8ed 100644 --- a/server/ceph_brag/json.py +++ b/server/ceph_brag/json.py @@ -22,7 +22,8 @@ def jsonify_cluster_info(ci): @jsonify.register(db.components_info) def jsonify_components_info(comps): return dict( - num_bytes=comps.num_bytes, + num_data_bytes=comps.num_data_bytes, + num_bytes_total=comps.num_bytes_total, num_osds=comps.num_osds, num_objects=comps.num_objects, num_pgs=comps.num_pgs, diff --git a/server/ceph_brag/model/db.py b/server/ceph_brag/model/db.py index 94d98ffc04d..5dfc745d8b7 100644 --- a/server/ceph_brag/model/db.py +++ b/server/ceph_brag/model/db.py @@ -35,7 +35,8 @@ class components_info(Base): index = Column(Integer, primary_key=True) vid = Column(ForeignKey('version_info.index')) - num_bytes = Column(BigInteger) + num_data_bytes = Column(BigInteger) + num_bytes_total = Column(BigInteger) num_osds = Column(Integer) num_objects = Column(Integer) num_pgs = Column(Integer) @@ -168,7 +169,8 @@ def put_new_version(data): def add_components_info(vi): comps_count= info['components_count'] comps_info = components_info(vid=vi.index, - num_bytes=comps_count['num_bytes'], + num_data_bytes=comps_count['num_data_bytes'], + num_bytes_total=comps_count['num_bytes_total'], num_osds=comps_count['num_osds'], num_objects=comps_count['num_objects'], num_pgs=comps_count['num_pgs'],