Project

General

Profile

Actions

Feature #39528

open

Adding number of buckets in radosgw-admin user stats command

Added by Vikhyat Umrao almost 5 years ago. Updated almost 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Something like:

- Current:

# radosgw-admin user stats --uid=ceetest
{
    "stats": {
        "total_entries": 334,
        "total_bytes": 86247782,
        "total_bytes_rounded": 87060480
    },
    "last_stats_sync": "2019-04-17 17:39:25.958492Z",
    "last_stats_update": "2019-04-17 17:39:25.937904Z" 
}

- Proposed:

# radosgw-admin user stats --uid=ceetest
{
    "stats": {
        "total_buckets_count": N <==================
        "total_entries": 334,
        "total_bytes": 86247782,
        "total_bytes_rounded": 87060480
    },
    "last_stats_sync": "2019-04-17 17:39:25.958492Z",
    "last_stats_update": "2019-04-17 17:39:25.937904Z" 
}
Actions #1

Updated by Vikhyat Umrao almost 5 years ago

We have the following command for now.

radosgw-admin bucket list  --uid=ceetest 

We can use `wc -l` to count but it would be great to have this command.

Actions #2

Updated by Vikhyat Umrao almost 5 years ago

For now, this script works.

cat bucket_count_per_user.sh

#!/bin/bash
username=$1
bucket_count=$(radosgw-admin bucket list --uid=$username | egrep -v "\]|\[" | wc -l)
echo "Owner: $username" 
echo "Bucket_count: $bucket_count" 

Output:

# ./bucket_count_per_user.sh testuser
Owner: testuser
Bucket_count: 8
Actions

Also available in: Atom PDF