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

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

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

Conversation

joyvuu-dave
Copy link
Owner

@joyvuu-dave joyvuu-dave commented Jan 8, 2025

724c3fa
Seed Usage Event records
Useful for integration testing. May only be needed while validating Usage Consumer feature.

aae2a03
Fix a typo

00d905b
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.

c9d50ec
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.

3faa80c
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.

8395537
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.

7bfe9f4
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

  • 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 joyvuu-dave force-pushed the usage_consumer branch 7 times, most recently from dad9f53 to eafa07e Compare January 14, 2025 17:04
@joyvuu-dave joyvuu-dave force-pushed the usage_consumer branch 4 times, most recently from 9dbb8c2 to c67ebd1 Compare January 21, 2025 04:11
@joyvuu-dave joyvuu-dave changed the title Keep Usage Event records corresponding to running and unprocessed App… Keep Usage Event records for running / unprocessed AppUsageEvent & ServiceUsageEvent records Jan 21, 2025
@joyvuu-dave joyvuu-dave changed the title Keep Usage Event records for running / unprocessed AppUsageEvent & ServiceUsageEvent records Keep Usage Event records of running & un-processed Apps and Services Jan 21, 2025
@joyvuu-dave joyvuu-dave force-pushed the usage_consumer branch 3 times, most recently from fc42d07 to 27505b2 Compare January 21, 2025 17:49
@joyvuu-dave joyvuu-dave force-pushed the usage_consumer branch 3 times, most recently from d8c42f2 to a2a928d Compare January 28, 2025 13:37
@joyvuu-dave joyvuu-dave force-pushed the usage_consumer branch 4 times, most recently from cddfffe to 81a870e Compare February 4, 2025 21:51
joyvuu-dave and others added 6 commits February 6, 2025 07:45
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.
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