core icon indicating copy to clipboard operation
core copied to clipboard

Users disk usage

Open hoerup opened this issue 13 years ago • 23 comments

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)

hoerup avatar Jan 28 '13 14:01 hoerup

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

kiranos avatar Jul 25 '13 17:07 kiranos

Agree @kiranos !

0xd3adcafe avatar Aug 15 '13 05:08 0xd3adcafe

Should be fixed with #7151 (duplicating)

nickvergessen avatar Feb 18 '14 15:02 nickvergessen

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

jospoortvliet avatar Jan 04 '16 12:01 jospoortvliet

@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)

madmas avatar Jan 05 '16 06:01 madmas

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

blizzz avatar Jan 05 '16 11:01 blizzz

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).

jospoortvliet avatar Jan 06 '16 20:01 jospoortvliet

What about https://apps.owncloud.com/content/show.php/Storage+Usage+%2B+Activity+Charts?content=166746 for now?

ghost avatar Jan 22 '16 14:01 ghost

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 avatar Mar 17 '16 10:03 PVince81

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 avatar Sep 08 '16 08:09 PVince81

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

PVince81 avatar Sep 08 '16 08:09 PVince81

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

vecjh avatar Nov 29 '16 11:11 vecjh

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 https://github.com/owncloud/core/issues/1344#issuecomment-245526902 and include its result for each returned user

PVince81 avatar Nov 29 '16 11:11 PVince81

  • [ ] requires API: https://github.com/owncloud/core/issues/26829

PVince81 avatar Dec 16 '16 09:12 PVince81

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 avatar Dec 22 '16 07:12 PVince81

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 avatar Dec 22 '16 07:12 PVince81

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';

PVince81 avatar Feb 17 '17 14:02 PVince81

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;

JackSlateur avatar Jul 05 '17 12:07 JackSlateur

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

geekonthepc avatar May 24 '18 12:05 geekonthepc

@pmaier1

PVince81 avatar May 29 '18 11:05 PVince81