UNPKG

cdk-monitoring-constructs

Version:

[![NPM version](https://badge.fury.io/js/cdk-monitoring-constructs.svg)](https://badge.fury.io/js/cdk-monitoring-constructs) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.cdklabs/cdkmonitoringconstructs/badge.svg)](https://m

71 lines (70 loc) 3.6 kB
import { IAutoScalingGroup } from "aws-cdk-lib/aws-autoscaling"; import { BaseMetricFactory, BaseMetricFactoryProps, MetricFactory, MetricStatistic, MetricWithAlarmSupport } from "../../common"; export interface IEC2MetricFactoryStrategy { createMetrics(metricFactory: MetricFactory, metricName: string, statistic: MetricStatistic, region?: string, account?: string, label?: string): MetricWithAlarmSupport[]; } export interface EC2MetricFactoryProps extends BaseMetricFactoryProps { /** * Auto-Scaling Group to monitor. * @default - no Auto-Scaling Group filter */ readonly autoScalingGroup?: IAutoScalingGroup; /** * Selected IDs of EC2 instances to monitor. * @default - no instance filter */ readonly instanceIds?: string[]; } export declare class EC2MetricFactory extends BaseMetricFactory<EC2MetricFactoryProps> { protected readonly strategy: IEC2MetricFactoryStrategy; constructor(metricFactory: MetricFactory, props: EC2MetricFactoryProps); /** * The percentage of allocated EC2 compute units that are currently in use on the instance. * This metric identifies the processing power required to run an application on a selected instance. * Depending on the instance type, tools in your operating system can show a lower percentage than * CloudWatch when the instance is not allocated a full processor core. */ metricAverageCpuUtilisationPercent(): MetricWithAlarmSupport[]; /** * Bytes read from all instance store volumes available to the instance. * This metric is used to determine the volume of the data the application reads from the hard disk of the instance. * This can be used to determine the speed of the application. */ metricAverageDiskReadBytes(): MetricWithAlarmSupport[]; /** * Bytes written to all instance store volumes available to the instance. * This metric is used to determine the volume of the data the application writes onto the hard disk of the instance. * This can be used to determine the speed of the application. */ metricAverageDiskWriteBytes(): MetricWithAlarmSupport[]; /** * Completed read operations from all instance store volumes available to the instance in a specified period of time. */ metricAverageDiskReadOps(): MetricWithAlarmSupport[]; /** * Completed write operations to all instance store volumes available to the instance in a specified period of time. */ metricAverageDiskWriteOps(): MetricWithAlarmSupport[]; /** * The number of bytes received on all network interfaces by the instance. * This metric identifies the volume of incoming network traffic to a single instance. */ metricAverageNetworkInRateBytes(): MetricWithAlarmSupport[]; /** * The number of bytes sent out on all network interfaces by the instance. * This metric identifies the volume of outgoing network traffic from a single instance. */ metricAverageNetworkOutRateBytes(): MetricWithAlarmSupport[]; /** * The number of bytes received on all network interfaces by the instance. * This metric identifies the volume of incoming network traffic to a single instance. */ metricSumNetworkInRateBytes(): MetricWithAlarmSupport[]; /** * The number of bytes sent out on all network interfaces by the instance. * This metric identifies the volume of outgoing network traffic from a single instance. */ metricSumNetworkOutRateBytes(): MetricWithAlarmSupport[]; private createDiskMetrics; private metric; }