Ask Your Question
0

user list

asked 2012-12-11 00:15:24 -0500

Is there a way to get a list of the users that have objects stored within a swift cluster? We want to do some per-user accounting/statistics and couldn't find a straightforward way to get the user list out. We don't want to just ask keystone since it may include users that haven't touched swift, and it may miss some users that are no longer active.

Thanks, Sam

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
0

answered 2012-12-17 22:30:01 -0500

clay-gerrard gravatar image

Doesn't slogging already make a pretty good run at this?

https://github.com/notmyname/slogging/blob/master/slogging/db_stats_collector.py (https://github.com/notmyname/slogging...)

edit flag offensive delete link more
0

answered 2012-12-17 21:33:48 -0500

This is kind of what I expected, but not what I wanted. Maybe its time to write a blueprint for an easier way to do this.

edit flag offensive delete link more
0

answered 2012-12-17 21:48:27 -0500

torgomatic gravatar image

Sure. If you want to have a go at coding it yourself, one fairly easy way would be to make the account auditor log the name of the account it's auditing (in, say, AccountAuditor.account_audit). Then getting a list of all accounts becomes a matter of log parsing.

I've only spent a minute or two thinking about this, though, so don't take the above as some sort of hard requirement. :)

edit flag offensive delete link more
0

answered 2012-12-17 21:13:16 -0500

torgomatic gravatar image

Well, there's no easy way, but there is a way.

You can find all the account databases on a node by looking in /srv/node//accounts//.db (e.g. "find /srv/node//accounts -name '.db'"), and then query each one of those for its account name ("SELECT account FROM account_stat"). Do that across all your nodes and deduplicate the list, and you've got all the accounts in your system.

With that in hand, you can do a series of HEAD requests to see how much stuff is stored under each account.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2012-12-11 00:15:24 -0500

Seen: 74 times

Last updated: Dec 17 '12