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 classes to model pod metrics and project invoices. #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

naved001
Copy link
Collaborator

The class Pod represent a pod's metrics and exposes methods to get the service unit and runtime of a pod. The service unit information is returned as a namedtuple. The method to get runtime will allow us to ignore certain hours, though, that will be added in a later commit.

The class ProjectInvoice represents invoice data for a project. It has a method that takes in a pod and aggregates it's usage data. Another method generate_invoice_rows will return the csv data to be exported.

The caller write_metrics_by_namespace has been updated to use these new classes.

Tests have been updated to work with the new changes. There's some duplicate constants that I will sort in the next few commits.

The method write_metrics_by_pod isn't updated yet since it's not critical and I wanted to keep the size of this PR down.

The class `Pod` represent a pod's metrics and exposes methods to get the
service unit and runtime of a pod. The service unit information is returned as
a namedtuples. The method to get runtime will allow us to ignore certain
hours, though, that will be added in a later commit.

The class `ProjectInvoice` represents invoice data for a project. It has a
method that takes in a pod and aggregates it's usage data. Another method
`generate_invoice_rows` will return the csv data to be exported.

The caller write_metrics_by_namespace has been updated to use these new classes.

Tests have been updated to work with the new changes. There's some duplicate
constants that I will sort in the next few commits.
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