Class: AwsMetricsEmitter

AwsMetricsEmitter()

new AwsMetricsEmitter()

Class representing an AWS CloudWatch metrics emitter.
Source:

Members

buffer

Gets the metrics data
Source:

buffer

Sets the metrics data
Source:

lastEmit

Gets the timestamp for when the metrics were last emitted
Source:

Methods

(static) flushBuffer(awsMetricsEmitter)

Flushes the buffer of all metrics and sets a timer based on the batchDelay
Parameters:
Name Type Description
awsMetricsEmitter AwsMetricsEmitter The aws metrics emitter that called the flush. Needed as self is not always the class the method belongs to.
Source:

emitBuffer()

Emits all metrics.
Source:

emitNamespaceMetrics(metrics)

Emits a set of metrics for a specific namespace.
Parameters:
Name Type Description
metrics object Metrics belonging to a single namespace.
Source:

start()

Starts emitting metrics after the delay period.
Source:

stop()

Stops emitting metrics immediately after this call, even if the batch delay has not been reached.
Source:

AwsMetricsEmitter(batchDelay, autoStart, cloudWatch, logger)

new AwsMetricsEmitter(batchDelay, autoStart, cloudWatch, logger)

Constructor for MetricsEmitter
Parameters:
Name Type Description
batchDelay number The number of millisencons to wait before sending the metrics data. If set to null or less than 1, then metrics will be emitted individually.
autoStart bool If true, then the emitter autimatically starts emitting mmetrics after the batch delay.
cloudWatch CloudWatch The CloudWatch export of the aws-sdk module. Automatically created if not defined. Mainly used for unit tests.
logger Logger The winston logger.
Source:

Members

buffer

Gets the metrics data
Source:

buffer

Sets the metrics data
Source:

lastEmit

Gets the timestamp for when the metrics were last emitted
Source:

Methods

(static) flushBuffer(awsMetricsEmitter)

Flushes the buffer of all metrics and sets a timer based on the batchDelay
Parameters:
Name Type Description
awsMetricsEmitter AwsMetricsEmitter The aws metrics emitter that called the flush. Needed as self is not always the class the method belongs to.
Source:

emitBuffer()

Emits all metrics.
Source:

emitNamespaceMetrics(metrics)

Emits a set of metrics for a specific namespace.
Parameters:
Name Type Description
metrics object Metrics belonging to a single namespace.
Source:

start()

Starts emitting metrics after the delay period.
Source:

stop()

Stops emitting metrics immediately after this call, even if the batch delay has not been reached.
Source: