Skip to content

Commit

Permalink
feat(stepfunctions): ExecutionTime metric (#2498)
Browse files Browse the repository at this point in the history
The `ExecutionTime` metric was not supported by the L2 `StateMachine` construct.
This PR adds a `metricTime()` function to `StateMachine`.

See https://docs.aws.amazon.com/step-functions/latest/dg/procedure-cw-metrics.html#cloudwatch-step-functions-execution-metrics
  • Loading branch information
Simon-Pierre Gingras authored and Elad Ben-Israel committed May 8, 2019
1 parent 417e5e8 commit 84fda45
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,15 @@ export class StateMachine extends Resource implements IStateMachine, events.IEve
public metricStarted(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return this.metric('ExecutionsStarted', props);
}

/**
* Metric for the interval, in milliseconds, between the time the execution starts and the time it closes
*
* @default sum over 5 minutes
*/
public metricTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return this.metric('ExecutionTime', props);
}
}

/**
Expand Down

0 comments on commit 84fda45

Please sign in to comment.