Add test: should display correct average of service wide average function duration

This commit is contained in:
Vlad Golubev 2017-01-06 21:46:15 +02:00
parent 7d7f7c7054
commit f2eaae5517

View File

@ -460,6 +460,27 @@ describe('AwsMetrics', () => {
});
});
it('should display correct average of service wide average function duration', () => {
const metrics = [
[
{
Label: 'Duration',
Datapoints: [{ Average: 100 }, { Average: 200 }, { Average: 300 }],
},
],
[
{
Label: 'Duration',
Datapoints: [{ Average: 400 }, { Average: 500 }],
},
],
];
return awsMetrics.showMetrics(metrics).then((message) => {
expect(message).to.include('Duration (avg.): 300ms');
});
});
it('should display function metrics if function option is specified', () => {
awsMetrics.options.function = 'function1';