-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rbd: expose pool stats summary tool #24830
Conversation
dillaman
commented
Oct 30, 2018
- References tracker ticket
- Updates documentation if necessary
- Includes tests for new functionality or reproducer for bug
9f94937
to
75c4331
Compare
@dillaman It looks like you squshed wrong commits. |
75c4331
to
00b145b
Compare
@trociny Indeed -- thx and fixed. |
00b145b
to
f9bb466
Compare
@trociny bit the bullet and went w/ your original suggestion to have dynamic stat querying. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
src/test/pybind/test_rbd.py
Outdated
eq(stats['trash_count'], 0) | ||
eq(stats['trash_provisioned_bytes'], 0) | ||
eq(stats['trash_max_provisioned_bytes'], 0) | ||
eq(stats['trash_snap_count'], 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running all pybind tests it fails with:
======================================================================
FAIL: test_rbd.test_pool_stats
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/mgolub/ceph/ceph.ci/src/test/pybind/test_rbd.py", line 119, in _require_new_format
return fn(*args, **kwargs)
File "/home/mgolub/ceph/ceph.ci/src/test/pybind/test_rbd.py", line 397, in test_pool_stats
eq(stats['trash_count'], 0)
AssertionError: 1L != 0
Which is due to TestTrash.test_remove_denied
not doing necessary cleanup. Anyway, probably a good idea to additionally run rbd.pool_stats_get
before creating the images to make sure the pool is empty?
And you need to do the images cleanup too, because after fixing TestTrash.test_remove_denied
by adding
RBD().trash_remove(ioctx, image_id, True)
I start to observe:
======================================================================
FAIL: test_rbd.test_list_empty
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/ssd/ceph/ceph.ci/src/test/pybind/test_rbd.py", line 314, in test_list_empty
eq([], RBD().list(ioctx))
AssertionError: [] != [u'image175', u'image176', u'image177', u'image178']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trociny Sorry about that -- should be better now
The init method is a stub for handling new pool initialization. It currently only handles setting the application tag. The stats method will quickly calculate the number of images and provisioned space for those images within the pool. Querying the pool stats on a pool with 10,000 images only required approximately 2 seconds as compared to over 2 minutes for a "rbd ls -l" scan. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This provides a quick summary of provisioned pool usage. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
f9bb466
to
1a14963
Compare