Giter Site home page Giter Site logo

mckaygerhard / storagestats Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cnrs-dsi-dev/dashboard

0.0 3.0 0.0 445 KB

Owncloud app that provide some global usage statistics of global space available and usage.

License: GNU Affero General Public License v3.0

PHP 69.95% CSS 2.80% JavaScript 27.26%

storagestats's Introduction

Dashboard

Owncloud 7 app that summarizes some global informations on local owncloud instance usage.

These informations are gathered :

  • total used space,
  • nb of users,
  • global folders nb,
  • global files nb,
  • global shares nb,
  • (mean) file size per user,
  • (mean) nb of folders per user,
  • (mean) nb of files per user,
  • (mean) nb of shares per user,
  • (mean) size per folder,
  • (mean) files per folder,
  • (mean) size per file,
  • (standard deviation) nb of files per user,
  • (standard deviation) nb of folders per user,
  • (standard deviation) nb of shares per user

Cron task is used for historization and chart may be displayed for the last week, month, semester or year for one the data in the list above.

Stats by group (v1.2+)

Stats may be filtered by group. In this last case, standard variations are not provided.

You must set the group list - on admin page - if you want to activate stats by group, and if so, for which groups. These groups will be used by cron job. The group list filter box on dashboard page is built from what is present in database for the chosen time range.

JSON API

JSON API is provided

Real time stats extracting : [owncloud]/index.php/apps/dashboard/api/1.0/stats.[format]

History stats : [owncloud]/index.php/apps/dashboard/api/1.0/history_stats/[group_id]/[format]/[dataType]/[nbDays]/[wantHumanreadable]

where

  • [owncloud] is the web url to your owncloud instance
  • [group_id] is the group id (gid) you want to filter on. If you want global infos (all groups), set it to 'none'.
  • [format] is the format in which you want your stats ('json' or 'xml')
  • [dataType] is one of totalUsedSpace, nbUsers,nbFolders, nbFiles,nbShares, sizePerUser, foldersPerUser, filesPerUser, sharesPerUser, sizePerFolder, filesPerFolder, sizePerFile, stdvFilesPerUser, stdvFoldersPerUser, stdvSharesPerUser.
  • [nbDays] is the number of days from todays you want datas.
  • [wantHumanreadable] allows you to choose if you want human readable values (set to 1) or not (set to 0)

Human readable values are only possible for total used space, file size per user, size per folder or size per file. For example, 2147483647 bytes will be displayed as 2 GB. If you set wantHumanReadable to 1, a unit property will be added to the result, containing the adequate units.

Warning, as for ownCloud 7.0.3RC2, you must set all these parameters ([group_id], [format], [dataType], [nbDays], [wantHumanreadable]) in urls. Like this : [owncloud]/index.php/apps/dashboard/api/1.0/history_stats/json/none/nbUsers/30/0

Please note that this json api has public access. A restriction mechanism may be added later but is not present for now. In the meantime, .htaccess may be used to restrict access by IP, for instance.

Random test datas

A command line utility exists, allowing to populate this app history tables with random datas.

Usage:

cd [owncloud]/
./occ dashboard:populate

where [owncloud] is the install folder of your owncloud instance

Warning : datas are added to the table, so you may want to truncate the *prefix*dashboard_history and *prefix*dashboard_history_by_group tables before running this command. The -t option does the job for you. Cf ./occ help dashboard:populate for more informations.

Install

The dashboard app must be put in the owncloud apps directory, with the name "dashboard" (without any number).

Dashboard app can be accessed by anyone. As the app gives informations about your entire owncloud instance, I would advise you to restrict access to choosen groups of users (see app install panel).

The stats will be updated with the next cron run. Stats are timestamped / logged only once a day.

Contributing

This app is developed for an internal deployement of ownCloud at CNRS (French National Center for Scientific Research).

If you want to be informed about this ownCloud project at CNRS, please contact [email protected], [email protected] or [email protected]

License and Author

Author: Patrick Paysant ([email protected])
Copyright: Copyright (c) 2014 CNRS DSI
License: AGPL v3, see the COPYING file.

storagestats's People

Contributors

gonetil avatar mckaygerhard avatar ppaysant avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.