This repository was archived by the owner on Jun 2, 2021. It is now read-only.
Commit 263d771
Create consistent AppUsageEvent records
When a user makes a POST to
/v2/app_usage_events/destructively_purge_all_and_reseed_started_apps,
all existing AppUsageEvent records are purged from the database and new
AppUsageEvent records are created for any running processes. This action
is taken by clients who may have missed previous events that have now
been pruned from the database as part of routeine mainteance and now
need a new starting spot for tracking usage.
All AppUsageEvent records created outside of a purge and reseed action
will have their parent_app_name and parent_app_guid fields set. This
change makes AppUsageEvent recoreds created as a result of a purge
consistent with all other records in that respect.
Not having the parent_app_name and parent_app_guid fields set was
causing 3rd party usage monitoring systems that expected their presence
to break.
Authored-by: Dave Riddle <driddle@pivotal.io>1 parent 9d48077 commit 263d771
2 files changed
Lines changed: 9 additions & 0 deletions
File tree
- app/repositories
- spec/unit/repositories
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
549 | 556 | | |
550 | 557 | | |
551 | 558 | | |
| |||
0 commit comments