Skip to content

Commit 84fda45

Browse files
Simon-Pierre GingrasElad Ben-Israel
Simon-Pierre Gingras
authored and
Elad Ben-Israel
committedMay 8, 2019
feat(stepfunctions): ExecutionTime metric (#2498)
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
1 parent 417e5e8 commit 84fda45

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

Diff for: ‎packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts

+9
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,15 @@ export class StateMachine extends Resource implements IStateMachine, events.IEve
193193
public metricStarted(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
194194
return this.metric('ExecutionsStarted', props);
195195
}
196+
197+
/**
198+
* Metric for the interval, in milliseconds, between the time the execution starts and the time it closes
199+
*
200+
* @default sum over 5 minutes
201+
*/
202+
public metricTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
203+
return this.metric('ExecutionTime', props);
204+
}
196205
}
197206

198207
/**

0 commit comments

Comments
 (0)