-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add metering archive #148
Merged
Merged
Add metering archive #148
Conversation
This file contains 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
And include archive location information in initial csp config dict.
This includes a data rotation based on max length attr.
Add hookspecs for data archive
Add archive retention period config option
To clarify what will be stored in the data archive. This will contain a list of meterings and also the relevant usage records for each metering.
Cleanup docstring and readme
Add util function to handle archive update
In the return section of docstring.
Add full docstring to function
And integrate archive into the adapter event loop. Each billing cycle is archived with metering and usage info included. With a default archive length of 6 months.
Implement archive record function
This sets the max length of the archive in bytes. If the archive grows larger than this limit the archive is trimmed until it satisfies the limit. For k8s products this limit is 1MiB or 1048576 bytes. If the limit is set to 0 there is no size limit. The archive can grow as large as the retention period.
But do not re-raise or add error to csp config which marks the adapter as in an unsupported state. Archive failure is not critical.
Drop defaults as these are not functional. The way the config is written a value must be provided in config. - Treat a 0 or 1 in bytes limit as "disable archive" - Treat < 1 in retention period as "disable archive" - Treat < 0 in bytes limit as no limit
Catch and log non-fatal archive error
Add archive bytes limit option to config
And clean up option description for archive values in example config.
Co-authored-by: Fergal Mc Carthy <[email protected]>
Update readme with details about archive
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.
Tracker PR. Merging feature branch to main.