in lib/template/pattern/cloudwatch-pattern.ts [133:153]
public createIotMetric(ruleName: string, metricName: string, actionType: string, options: cloudwatch.MetricOptions = {}): cloudwatch.Metric {
/*
Options:
- Sum : cloudwatch.Unit.COUNT
- Average/Minimum/Maximum : Milliseconds
*/
return new cloudwatch.Metric({
metricName,
namespace: 'AWS/IoT',
dimensions: {
RuleName: ruleName,
ActionType: actionType
},
statistic: options.statistic, // Sum
unit: options.unit, //cloudwatch.Unit.COUNT
period: this.props.period,
label: options.label != undefined ? options.label : metricName,
...options
});
}