newTimingAggregator creates a new aggregator which measures the duration of resource init/plan/apply actions; stage represents the stage of provisioning the timings are occurring within.
(stage database.ProvisionerJobTimingStage)
| 95 | // newTimingAggregator creates a new aggregator which measures the duration of resource init/plan/apply actions; stage |
| 96 | // represents the stage of provisioning the timings are occurring within. |
| 97 | func newTimingAggregator(stage database.ProvisionerJobTimingStage) *timingAggregator { |
| 98 | return &timingAggregator{ |
| 99 | stage: stage, |
| 100 | stateLookup: make(map[uint64]*timingSpan), |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | // ingest accepts a timing span at a certain timestamp and assigns it a state according to the kind of timing event. |
| 105 | // We memoize start & completion events, and then calculate their total duration in aggregate. |
no outgoing calls