Skip to content

Commit fdf84ac

Browse files
author
Alan Churley
committed
Moving stored metrics type definition to types file
1 parent 968826f commit fdf84ac

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

packages/metrics/src/Metrics.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { MetricsInterface } from '.';
22
import { ConfigServiceInterface, EnvironmentVariablesService } from './config';
3+
34
import {
45
DecoratorOptions,
56
Dimensions,
67
EmfOutput,
78
HandlerMethodDecorator,
9+
StoredMetrics,
810
MetricsOptions,
911
MetricUnit,
1012
MetricUnits
@@ -24,7 +26,7 @@ class Metrics implements MetricsInterface {
2426
private metadata: { [key: string]: string } = {};
2527
private namespace?: string;
2628
private raiseOnEmptyMetrics: boolean = false;
27-
private storedMetrics:{ [key: string]: { name: string; unit: MetricUnit; value: number } } = {};
29+
private storedMetrics: StoredMetrics = {};
2830

2931
public constructor(options: MetricsOptions = {}) {
3032
this.dimensions = {};

packages/metrics/types/Metrics.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,21 @@ type DecoratorOptions = {
3434
captureColdStartMetric?: boolean
3535
};
3636

37+
type StoredMetric = {
38+
name: string
39+
unit: MetricUnit
40+
value: number
41+
};
42+
43+
type StoredMetrics = {
44+
[key: string]: StoredMetric
45+
};
46+
3747
export {
3848
DecoratorOptions,
3949
Dimensions,
4050
EmfOutput,
51+
HandlerMethodDecorator,
4152
MetricsOptions,
42-
HandlerMethodDecorator
53+
StoredMetrics
4354
};

0 commit comments

Comments
 (0)