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

rgw: usage #14287

Merged
merged 8 commits into from Jul 20, 2017

Conversation

Projects
None yet
6 participants
@oritwas
Contributor

oritwas commented Apr 2, 2017

rebase of #8043 with small fixups
Fixes: http://tracker.ceph.com/issues/16191

@liewegas liewegas changed the title from Wip rgw usage to rgw: usage Apr 3, 2017

struct rgw_bucket_category_stats& header_stats = iter->second;
for (auto hiter : headers) {
for (auto iter : hiter.second.stats) {
struct rgw_bucket_category_stats& header_stats = iter.second;

This comment has been minimized.

@cbodley

cbodley Apr 3, 2017

Contributor

careful with copies in these for loops. iter here is a pair<uint8_t, rgw_bucket_category_stats>, rather than a map<uint8_t, rgw_bucket_category_stats>::iterator, so you need const auto& iter to avoid making a copy

@oritwas

This comment has been minimized.

Contributor

oritwas commented Apr 3, 2017

jenkins test this please

return ret;
}
int r = cls_bucket_head(bucket_info, RGW_NO_SHARD, headers);

This comment has been minimized.

@theanalyst

theanalyst Apr 3, 2017

Member

nit: we can reuse the ret from earlier

@oritwas

This comment has been minimized.

Contributor

oritwas commented Apr 3, 2017

jenkins test this please

string user_str = s->user->user_id.to_str();
op_ret = store->cls_user_get_header(user_str, &header);
if (op_ret < 0) {
ldout(store->ctx(), 0) << "ERROR: can't read user header: " << dendl;
return ;
return;
}
return;

This comment has been minimized.

@theanalyst

theanalyst Apr 4, 2017

Member

this isn't a part of changeset, but this return is redundant

map<uint8_t, struct rgw_bucket_category_stats>::iterator iter = hiter->second.stats.begin();
for (; iter != hiter->second.stats.end(); ++iter) {
struct rgw_bucket_category_stats& header_stats = iter->second;
for (auto hiter : headers) {

This comment has been minimized.

@cbodley

cbodley Apr 4, 2017

Contributor

const auto& hiter

return ret;
}
map<string, RGWBucketEnt>& buckets = user_buckets.get_buckets();
for (auto i : buckets) {

This comment has been minimized.

@cbodley

cbodley Apr 4, 2017

Contributor

const auto& i

@cbodley

cbodley approved these changes Apr 5, 2017

@@ -53,6 +53,9 @@ extern int rgw_user_sync_all_stats(RGWRados *store, const rgw_user& user_id);
/**
* Get the anonymous (ie, unauthenticated) user info.
*/
extern int rgw_user_get_all_buckets_stats(RGWRados *store, const rgw_user& user_id, map<string, cls_user_bucket_entry>&buckets_usage_map);

This comment has been minimized.

@cbodley

cbodley Apr 20, 2017

Contributor

nit: the block comment above applies to the rgw_get_anon_user() declaration below - could you move this declaration?

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Apr 26, 2017

@oritwas ping?

chenji-kael and others added some commits Mar 7, 2016

get usage now get capacity used by each bucket
Fixes:tracker.ceph.com/issues/16191
Signed-off-by: Ji Chen <insomnia@139.com>
remove start end-date from signed_subresources
Fixes:tracker.ceph.com/issues/16191
Signed-off-by: Ji Chen <insomnia@139.com>
rgw: use c++11 loops for cls_user_get_bucket_stats and rgw_user_get_a…
…ll_buckets_stats

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
rgw: use emplace not insert
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
rgw: more c++1 loop style
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
rgw: reuse ret
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
rgw: use const reference to avoid copy
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
rgw: move gw_user_get_all_buckets_stats decleration above the comment
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
@oritwas

This comment has been minimized.

Contributor

oritwas commented May 4, 2017

@cbodley , fixed and rebase

@cbodley

This comment has been minimized.

Contributor

cbodley commented Jul 18, 2017

jenkins test this please

@cbodley cbodley added the needs-qa label Jul 19, 2017

@yuriw yuriw merged commit 94b02a6 into ceph:master Jul 20, 2017

6 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
Unmodified Submodules submodules for project are unmodified
Details
default Build finished.
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment