in lib/template/pattern/cloudwatch-pattern.ts [189:207]
public createEndpointInvocationMetrics(endpointName: string, variantName: string, metricNames: string[], options: cloudwatch.MetricOptions = {}): cloudwatch.Metric[] {
const metric: cloudwatch.Metric[] = metricNames.map(metricName => {
return new cloudwatch.Metric({
metricName,
namespace: 'AWS/SageMaker',
dimensions: {
EndpointName: endpointName,
VariantName: variantName,
},
statistic: options.statistic, // Sum, Average
unit: options.unit, //cloudwatch.Unit.COUNT Milliseconds
period: this.props.period,
label: options.label != undefined ? options.label : metricName,
...options
});
})
return metric;
}