Add Nightscout database size info row and alarm#697
Open
bjorkert wants to merge 1 commit into
Open
Conversation
Nightscout's dbsize plugin exposes the Mongo data + index size at /api/v2/properties/dbsize. Poll it on a new 6 hour scheduler task and surface it two ways: - An optional "DB Size" info row showing used MiB and the percentage of the site's configured DBSIZE_MAX. - A new "Nightscout Database Size" alarm that fires at or above a percentage threshold, defaulting to 75% to match the urgent level of the plugin itself. The database fills over weeks, so the alarm defaults to day-only and never repeats at night. Nightscout still reports the property with a zero size when db.stats() fails, which would read as an empty database rather than a missing reading. Treat that as no reading, mirroring how the plugin's own pill hides itself in that case.
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Nightscout's
dbsizeplugin exposes the database size at/api/v2/properties/dbsize. A new scheduler task polls it every 6 hours and surfaces the result in two places.Info row — a new optional
DB Sizerow showing used MiB and the percentage of the site's configured limit. Hidden by default.Alarm — a new
Nightscout Database Sizealarm firing at or above a percentage threshold, defaulting to 75% to match the plugin's own urgent level. The database fills over weeks, so it defaults to daytime only.The percentage is measured against
DBSIZE_MAX, which is 496 MiB unless the site owner changed it. The info row therefore leads with the absolute MiB figure, and the alarm editor explains the caveat.