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

statistics #49

Closed
9001 opened this issue Jul 31, 2023 · 1 comment
Closed

statistics #49

9001 opened this issue Jul 31, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@9001
Copy link
Owner

9001 commented Jul 31, 2023

a suggestion came up on discord to add statistics; making an issue for ideas / brainstorming

help-wanted: mostly for ideas (see labels below), but just in case someone feels adventurous enough to tackle the implementation as well, I was roughly planning to do it based on u2idx, doing direct sqlite3 queries

design

  • how should this work? There will be an html page with basic display of the metrics, but should probably also be made available over some api. I have briefly heard of things like nagios and grafana, but I don't know what kind of api these expect. What softwares can I use to test this / integrate with? Would appreciate suggestions! help-wanted
  • should this require user authentication / some specific access-level, or is it fine if anyone can read it? Some of the metrics would be expensive to compute, so requiring auth might be in order

metrics

List of metrics that are easy to add,

  • number of uploads and/or unique uploaders, in each volume or in total, during the last N hours/days/... Or within a given timespan (date-date)
  • number of files, total size, in each volume / in total
  • number of deduplicated files / amount of space saved due to dedup
  • number of currently banned IPs
  • Probably more... help-wanted

unlikely metrics

List of metrics that are unlikely to be added

  • visitor / downloads counter -- would likely have a performance impact even if the feature is not in use, and also non-trivial -- could probably be done by parsing nginx logs instead
@9001 9001 added the enhancement New feature or request label Jul 31, 2023
@9001 9001 self-assigned this Jul 31, 2023
@9001 9001 added the help wanted Extra attention is needed label Jul 31, 2023
@9001 9001 closed this as completed in fc0405c Aug 20, 2023
@9001
Copy link
Owner Author

9001 commented Aug 20, 2023

there is a stats/metrics endpoint at /.cpr/s/metrics which implements openmetrics 1.0.0

the following metrics were added:

  • server uptime
  • number of banned IPs
  • disk space available
  • disk space in use
  • volume size limit (bytes and num files)
  • current volume size (bytes and num files)
  • unfinished / incoming uploads (bytes and num files)

most of the metrics are listed per-volume and also as a total

the moving-window metrics mentioned previously (number of recent uploads and such) were not added because they don't appear to fit well in openmetrics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant