mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Add test: should display correct average of service wide average function duration
This commit is contained in:
parent
7d7f7c7054
commit
f2eaae5517
@ -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';
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user