Keep Usage Event records of running & un-processed Apps and Services#4374
Closed
joyvuu-dave wants to merge 9 commits intocloudfoundry:mainfrom
Closed
Keep Usage Event records of running & un-processed Apps and Services#4374joyvuu-dave wants to merge 9 commits intocloudfoundry:mainfrom
joyvuu-dave wants to merge 9 commits intocloudfoundry:mainfrom
Conversation
|
Contributor
Author
|
I should have CLA approval now -- is there a way to re-trigger this bot check? |
Better aligns with style used throughout codebase. Done in anticipation of adding more parameters to the `initialize` method.
AppUsageEvent and ServiceUsageEvent records can be used to track the lifecycle of apps and services in a foundation. However, if the start event is pruned before end event, the foundation no longer maintains an accurate state of its running apps and services. By holding on to the start events, consumers of these records are able to get an accurate picture of the current state whenever they choose to begin consuming usage event records.
Allow consumer_guid to be passed into request for AppUsageEvent and ServiceUsageEvent records. This establishes a consumer of these events. Un-processed consumer records will be maintained by cloud controller. Registered consumers are automatically deleted if associated event is removed.
Only keep un-processed records if usage event table size is below threshold. This is a safeguard to ensure row count does not grow unbounded in the event of a zombie consumer.
Allows for usage consumers to de-register themselves with the cloud controller. Index and show methods allow consumers to make informed decisions before initiating a purge of usage events. Usage event endpoint re-ordered to align with convention of other resources.
Useful for integration testing. May only be needed while validating Usage Consumer feature.
Keep it off by default
59c7f16 to
d180448
Compare
Contributor
Author
|
I'm going to close this PR and open a new one that focuses just on keeping records of running apps. |
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.
Addresses #4182
Commit
Allows users to turn on or off keep_unprocessed_records feature
Leave it off by default
Commit
Seed Usage Event records
Useful for integration testing. May only be needed while validating Usage Consumer feature.
Commit
Fix a typo
Commit
Provide index, show, and destroy endpoints for usage consumers
Allows for usage consumers to de-register themselves with the cloud controller. Index and show methods allow consumers to make informed decisions before initiating a purge of usage events.
Usage event endpoint re-ordered to align with convention of other resources.
Commit
Set threshold for keeping un-processed records
Only keep un-processed records if usage event table size is below threshold. This is a safeguard to ensure row count does not grow unbounded in the event of a zombie consumer.
Commit
Maintain un-processed usage event records
Allow consumer_guid to be passed into request for AppUsageEvent and ServiceUsageEvent records. This establishes a consumer of these events. Un-processed consumer records will be maintained by cloud controller. Registered consumers are automatically deleted if associated event is removed.
Commit
Keep usage event records of running apps and services
AppUsageEvent and ServiceUsageEvent records can be used to track the lifecycle of apps and services in a foundation. However, if the start event is pruned before end event, the foundation no longer maintains an accurate state of its running apps and services. By holding on to the start events, consumers of these records are able to get an accurate picture of the current state whenever they choose to begin consuming usage event records.
Commit
Make cutoff_age_in_days a named parameter
Better aligns with style used throughout codebase. Done in anticipation of adding more parameters to the
initializemethod.I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement <-- in progress
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests