Re: About the data movement in Ceph

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You might find it easier to use the python implementation for this (I certainly did). See attached (I was only interested in number of bytes, but the other metrics are available too)!

Cheers

Mark

On 28/09/13 14:48, Zh Chen wrote:
And recently i have another questions as follows,



5. I find that librados offer the api, and about this
rados_ioctx_pool_stat(rados_ioctx_t io, struct rados_pool_stat_t
*stats), if i want to query some pools' statistics and i need to declare
some rados_ioctx io or cluster handle that each for a pool? i found the
segment fault when the return for rados_ioctx_pool_stat.


#!/usr/bin/python
#
# python examples for RADOS api
#
# expects a config file ceph.conf in this directory,
# and a client keyring if cephx auth is enabled.
# additionally conf needs to mention the keyring file!

from rados import Rados

conn = Rados(conffile='./ceph.conf')

conn.connect()

pools = conn.list_pools()

for pool in pools:
    poolio = conn.open_ioctx(pool)
    poolstats = poolio.get_stats()
    print "{:30} {:10}".format(pool, poolstats['num_bytes'])
    poolio.close()

conn.shutdown()

_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux