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

Add metering archive #148

Merged
merged 21 commits into from
Jan 12, 2024
Merged

Add metering archive #148

merged 21 commits into from
Jan 12, 2024

Conversation

smarlowucf
Copy link
Collaborator

Tracker PR. Merging feature branch to main.

smarlowucf and others added 21 commits January 5, 2024 15:31
And include archive location information in initial csp config dict.
This includes a data rotation based on max length attr.
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.
Add util function to handle archive update
In the return section of docstring.
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.
Update readme with details about archive
@smarlowucf smarlowucf merged commit da4d706 into main Jan 12, 2024
6 checks passed
@smarlowucf smarlowucf deleted the data-archive branch January 12, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant