New metrics about files counting and type (WORK IN PROGRESS) #4

Open pmarini opened this issue on 29 Apr - 0 comments

@pmarini pmarini commented on 29 Apr

Add new metrics about files counting (in all code samples below datadirectory=/ncdata):

  • Total number of files assigned to users :

    • Filesystem method (faster): find /ncdata/*/files/ -not -path 'appdata*' -not -path '__groupfolders/*' | wc -l
    • DB query (can be set as control method): select count(*) from oc_filecache where storage in (select numeric_id from oc_storages where id like 'home::%') and SUBSTRING_INDEX(path, '/', 1)='files'
  • Total number of trashed files assigned to users:

    • Filesystem method (faster): find /ncdata/*/files_trashbin -not -path 'appdata*' -not -path '__groupfolders/*' | wc -l
    • DB query (can be set as control method): select count(*) from oc_filecache where storage in (select numeric_id from oc_storages where id like 'home::%') and SUBSTRING_INDEX(path, '/', 1)='files_trashbin'
  • Total number of group folders

    • TO DO
  • Total number of files living in group folders

    • Filesystem method (faster): find /ncdata/__groupfolders/ -not -path 'trash/*' -not -path 'versions/*' | wc -l
    • DB query (can be set as control method): select count(*) from oc_filecache where storage in (select numeric_id from oc_storages where id like 'local::%') and SUBSTRING_INDEX(path, '/', 1)='__groupfolders'
  • [TO COMPLETE] Total number of trashed files assigned to group folders:

    • Filesystem method (faster): find /ncdata/__groupfolders/trash/ | wc -l
    • DB query (can be set as control method):
Labels

Priority
default
Milestone
No milestone
Assignee
No one assigned
1 participant
@pmarini