UNPKG

2.04 kBTypeScriptView Raw
1import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
2declare module "./function-base" {
3 interface IFunction {
4 /**
5 * Return the given named metric for this Function
6 */
7 metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
8 /**
9 * How often this Lambda is throttled
10 *
11 * Sum over 5 minutes
12 */
13 metricThrottles(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
14 /**
15 * How often this Lambda is invoked
16 *
17 * Sum over 5 minutes
18 */
19 metricInvocations(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
20 /**
21 * How many invocations of this Lambda fail
22 *
23 * Sum over 5 minutes
24 */
25 metricErrors(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
26 /**
27 * How long execution of this Lambda takes
28 *
29 * Average over 5 minutes
30 */
31 metricDuration(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
32 }
33 interface FunctionBase {
34 /**
35 * Return the given named metric for this Function
36 */
37 metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
38 /**
39 * How often this Lambda is throttled
40 *
41 * Sum over 5 minutes
42 */
43 metricThrottles(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
44 /**
45 * How often this Lambda is invoked
46 *
47 * Sum over 5 minutes
48 */
49 metricInvocations(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
50 /**
51 * How many invocations of this Lambda fail
52 *
53 * Sum over 5 minutes
54 */
55 metricErrors(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
56 /**
57 * How long execution of this Lambda takes
58 *
59 * Average over 5 minutes
60 */
61 metricDuration(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
62 }
63}