Skip to content

Keep Usage Event records of running & un-processed Apps and Services #4374

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

joyvuu-dave
Copy link
Contributor

@joyvuu-dave joyvuu-dave commented May 27, 2025

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 initialize method.

  • 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 main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

joyvuu-dave and others added 8 commits May 27, 2025 10:46
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.
Copy link

CLA Not Signed

@joyvuu-dave
Copy link
Contributor Author

I should have CLA approval now -- is there a way to re-trigger this bot check?

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