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

Adds support for controlling the generic stats graph in a easy to use manner. #15801

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

VVelox
Copy link
Contributor

@VVelox VVelox commented Feb 4, 2024

Adds support for controlling the generic stats graph in a easy to use manner.

Adds in control for hourly, daily, and weekly averages, mins, and maxs. Also allows control for if a user wants to display the 25th/50th/75th or either of the two user definable percentiles.

generic_stats_options.inc.php is the new graph file that takes the options for that from vars in a generic fashion. Also sanity checks it and if it does not fine a sane value it just uses the default for that value.

generic_stats_options_init.inc.php inits using it for a apps graph page.

generic_stats_options_line.inc.php generates the options for use us in the options area for a app page.

Defaults...

Type Default
Hourly Avg True
Hourly Min False
Hourly Max False
Weekly Avg True
Weekly Min False
Weekly Max False
Daily Avg True
Daily Min False
Daily Max False
Percentile 25/50/75 True
Percentile x0 False
Percentile x1 False

The defaults for these are configurable via the global options menu.

https://cdn.discordapp.com/attachments/463435361100627988/1203793773604376576/Untitled.png

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
  • If my Pull Request makes discovery/polling/yaml changes, I have added/updated test data.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

@VVelox
Copy link
Contributor Author

VVelox commented Feb 4, 2024

Created this as we had a need to know the daily max average for some log stuff.

@PipoCanaja
Copy link
Contributor

Hi @VVelox
2nd image (hosted on discord) is gone. Do you have some kind of "before/after" and also a hint on how to use the features added by this PR. Including may be a bit of doc?

@VVelox
Copy link
Contributor Author

VVelox commented Apr 21, 2024

@PipoCanaja
image

@VVelox
Copy link
Contributor Author

VVelox commented Apr 21, 2024

@PipoCanaja Also added some docs for this on this and generic_stats.inc.php.

@murrant
Copy link
Member

murrant commented May 6, 2024

I'm not sure I understand what problem this PR is trying to solve.

@VVelox
Copy link
Contributor Author

VVelox commented May 6, 2024

I'm not sure I understand what problem this PR is trying to solve.

@murrant See the stats option line in the screen shot there. That adds that. Basically the purpose of this is to allow graph data to be dug into at way more depth than before. The original stats graph proved to be a handy start, put we started finding it a bit lacking with available information.

This allows what is displayed via graphs supporting this to be controlled.

This was originally born out of the need to get daily max stats as well. While that line is not that useful the bottom information line for like average, min, and max can be insanely useful for planning purposes.

@VVelox
Copy link
Contributor Author

VVelox commented May 6, 2024

This is something I want to begin expanding to other stats graph enabled apps in time. :)

@VVelox
Copy link
Contributor Author

VVelox commented May 6, 2024

Moving to draft to begin re-factoring to object based graphs. Thanks for the idea @murrant . <3

@VVelox VVelox marked this pull request as draft May 6, 2024 16:05
@murrant
Copy link
Member

murrant commented May 7, 2024

@VVelox start simple, don't try to do too much at once :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants