Skip to content
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

Users disk usage #1344

Closed
hoerup opened this issue Jan 28, 2013 · 23 comments
Closed

Users disk usage #1344

hoerup opened this issue Jan 28, 2013 · 23 comments

Comments

@hoerup
Copy link

hoerup commented Jan 28, 2013

When viewing the user list (settings/users.php) it would be nice to see each users current disk consumption / usage preferably both as a MB/GB number and as a percentage of quota (if set)

@kiranos
Copy link

kiranos commented Jul 25, 2013

I'd like this feature implemented, from a company standpoint looking at employees it would be nice to know.

@marlboromoo
Copy link

Agree @kiranos !

@nickvergessen
Copy link
Contributor

Should be fixed with #7151 (duplicating)

@jospoortvliet
Copy link

I don't think this ever made it in, it isn't in 8.2 at least... Am I wrong @blizzz ?

@madmas
Copy link

madmas commented Jan 5, 2016

@jospoortvliet I see it the same way, but it's also not checked in the checklist section "Additional Features" in #7151 (which has not been updated for a while now)

@blizzz
Copy link
Contributor

blizzz commented Jan 5, 2016

No, it's not in and there are no plans to get it into 9.0 either.

@jospoortvliet
Copy link

Ok so this should be kept open, unless we never want to do it and wouldn't accept patches (but I assume that that isn't the case and anybody can send a patch which takes care of this if they want).

@blizzz blizzz added this to the backlog milestone Jan 6, 2016
@ghost
Copy link

ghost commented Jan 22, 2016

@PVince81
Copy link
Contributor

Removing junior job tag, this is tricky and I remember @icewind1991 saying that the APIs aren't quite ready to make this work efficiently.

@PVince81
Copy link
Contributor

PVince81 commented Sep 8, 2016

This slightly twisted Mysql query can return the used space for all users:

MariaDB [owncloud]> select m.user_id, fc.size from oc_mounts m, oc_filecache fc, oc_storages s where m.mount_point=concat('/', m.user_id, '/') and s.numeric_id=m.storage_id and fc.storage=m.storage_id and fc.name='files';
+---------+---------+
| user_id | size    |
+---------+---------+
| admin   |     163 |
| user1   | 4774179 |
| user2   | 1571107 |
+---------+---------+
3 rows in set (0.00 sec)

I still wish there was a way to directly retrieve home storages and user ids from oc_storages...

@PVince81
Copy link
Contributor

PVince81 commented Sep 8, 2016

(which obviously wouldn't work for custom storage/cache implementations if someone decided to not use oc_filecache)

@vecjh
Copy link

vecjh commented Nov 29, 2016

are there any plans to include this functionality in the upcoming versions?

@PVince81
Copy link
Contributor

Not for 9.2.

But if anyone volunteers to work on it and submit a PR, we can include it.
The way I see it, the minimum required work is as follows:

  • add an optional field in the users page to display the disk usage
  • the field must be disable-able using the settings on the bottom left
  • if the setting is disabled, the SQL query must not run as it can be expensive
  • if the setting is enabled, querying the user list would run the query from Users disk usage #1344 (comment) and include its result for each returned user

@PVince81
Copy link
Contributor

@PVince81
Copy link
Contributor

Looks like the provisioning API already returns the usage quota.
However the web UI uses a different API. It should be possible to reuse whatever the provisioning API is using to get the usage and display it in the users page.

@PVince81
Copy link
Contributor

Acceptance criteria from the closed duplicate ticket:

As an admin, I want to be able to easily and quickly see the current quota usage of all of the users on the system.

Acceptance Criteria:
This should be integrated in the user management panel. This displays the % of used quota next to the quota drop down for each user in the table. The option is set in the settings panel on the bottom left (the gear). When the option is selected, a new column appears with this info displayed

@PVince81
Copy link
Contributor

The query has a small mistake. It must be "fc.path", not "fc.name".

Here:

select m.user_id, fc.size from oc_mounts m, oc_filecache fc, oc_storages s where m.mount_point=concat('/', m.user_id, '/') and s.numeric_id=m.storage_id and fc.storage=m.storage_id and fc.path='files';

@JackSlateur
Copy link

JackSlateur commented Jul 5, 2017

And with sorted human-size:

select m.user_id, concat(convert(fc.size / 1024 / 1024, integer), 'MB') as size from oc_mounts m, oc_filecache fc, oc_storages s where m.mount_point=concat('/', m.user_id, '/') and s.numeric_id=m.storage_id and fc.storage=m.storage_id and fc.path='files' order by fc.size desc;

@geekonthepc
Copy link

Hi, is there any chance of this being followed up as it would be very useful to be able to see user quota usage?

@PVince81
Copy link
Contributor

@pmaier1

@matfiz
Copy link

matfiz commented Oct 25, 2018

@ownclouders if community proposes PR with this, would it be accepted, or there is some (personal info?) reason why it should not be added?

@pmaier1
Copy link
Contributor

pmaier1 commented Oct 29, 2018

if community proposes PR with this, would it be accepted, or there is some (personal info?) reason why it should not be added?

Yes, you're more than welcome to go for a PR, absolutely. The solution needs to work performant in installations with several thousands of users. That's the main pain point, I guess.
If you want to contribute, you're welcome join our public chat on talk.owncloud.com to get in touch.

@micbar
Copy link
Contributor

micbar commented Sep 16, 2021

Was implemented in the metrics app as an enterprise feature.

@micbar micbar closed this as completed Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests