-
Notifications
You must be signed in to change notification settings - Fork 13
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
[COST-3571] generate daily reports #184
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
b97bc77
only collect full days of previous data
maskarb 3a9d244
update test
maskarb 2271bdf
fix some logic
maskarb 9f77411
fix test
maskarb f5470a7
update logging for ErrNoData
maskarb 490c109
collect 4 days data before packaging
maskarb 46841d8
add comment
maskarb 32c359f
update variable name
maskarb 681662d
move status update to daily loop rather than in the packing branch
maskarb c569a41
but more specific when breaking from loop
maskarb f1f1775
oof
maskarb ed688bd
use enum
maskarb 8f4ee2a
update comment
maskarb 0061453
update comment
maskarb d2e9d37
remove panic
maskarb 3f5326f
make FilesAction a func type
maskarb 9b61390
simplify copy method
maskarb 19b9b7e
update tests
maskarb b32c9d4
update workflow
maskarb 5c3aa66
fix the workflow
maskarb 98ab8cb
fix the workflow
maskarb 2231126
update CI workflow
maskarb ec20c49
Merge branch 'main' into collect-full-days-previous
maskarb 37f3912
use constant
maskarb d762111
Merge branch 'main' into collect-full-days-previous
maskarb 1672bd7
add gomock and update ginkgo to v2
maskarb 7e45f59
add mocks
maskarb 0951326
create mocks package
maskarb a2e78db
remove focus
maskarb 91eb659
update workflow
maskarb f861725
idk why this doesnt work :(
maskarb 7ad570f
eliminate the need for renaming the CR
maskarb 49d4b60
finallyyyyyy
maskarb bdf731b
more udpates
maskarb ba3b048
ITS WORKING SO MUCH BETTER
maskarb 53fafdf
move status setting
maskarb 5c184d6
remove focus
maskarb 8c93bd1
add test
maskarb fe8e4de
add very complicated test
maskarb 7735f6a
account for single line item in pod report
maskarb 6ab3e1e
rename to test file
maskarb 74d9ed1
add bigger tests
maskarb 0296845
add end of day test
maskarb eb4a087
some cleanup
maskarb ae5bce8
remove interface
maskarb 010f02f
format timestamp
maskarb 59e7820
fix test assertions
maskarb 1e7a74c
remove unused var
maskarb af50e17
add comment
maskarb 196b0b2
add flag to manifest
maskarb 22e70fb
update tests to correctly count reports
maskarb ab2203d
use constant
maskarb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might still split into multiple files for the 4 day period? Also anything specific about the 96 mark or just feels right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here was to fit the number of reports into the default max of 30. Assuming a cluster has 90 days of data, this would generate 90*24/96 ~= 23 reports.
If the reports are too big and require splitting, then yea, this logic goes out the window. But it is a best effort to fit a full 90 days into 30 reports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about this some more, when we split a payload, that is still counted as a single report. Here is the logic for that:
https://github.com/project-koku/koku-metrics-operator/blob/main/packaging/packaging.go#L428-L435
We get the timestamp from the tar.gz and insert into a set, then count the length of the set.
All payloads from a split report use this basename:
https://github.com/project-koku/koku-metrics-operator/blob/main/packaging/packaging.go#L517
which is just
TIMESTAMP-cost-mgmt...