cloudfoundry/cloud_controller_ng — pull request #230 by sykesm (2014-05-08 16:11:59+00:00)
Title: Staged event

App usage events are currently created every time the desired state of an application goes from `STARTED` to `STOPPED` or when the desired instance count or memory allocation of a `STARTED` app changes. A requirement has been raised to add buildpack information to these events but the buildpack data is not always known at the time the desired state of an app transitions to `STARTED`.

Since there are hard requirements to have events associated with the existing `STARTED` and `STOPPED` states created without introducing windows where events are duplicated or recorded out of order and to ensure that events are immutable, the tactical resolution was to introduce a new state called `BUILDPACK_SET` that represents a simple buildpack update. While not ideal, it surfaces the information without breaking existing code that depends on the `STARTED` and `STOPPED` events.

This change records app usage events containing buildpack information when staging completes.

The name of the event can change but I was given explicit direction from @MarkKropf to avoid names that included or implied association with staging.