Class: AwsMetricsBuffer

AwsMetricsBuffer(logger)

new AwsMetricsBuffer(logger)

Constructor for AwsMetricsBuffer.
Parameters:
Name Type Description
logger Logger The winston logger.
Source:

Methods

(static) aggregateMetricDatum(metricDatum, value)

Aggregates the value to the statistic set of the metric datum passed in. If there is currently not a statistic set, then one is created.
Parameters:
Name Type Description
metricDatum AwsMetricDatum The metric datum.
value string The value to aggregate the metric datum by.
Source:

(static) dimensionsAreEqual(a, b)

Compares two dimensions objects to see if they are equivilant to each other.
Parameters:
Name Type Description
a *
b *
Source:

addMetricDatum(namespace, metricName, dimensions, unit, value, aggregate)

Adds a metric datum to the buffer, aggregating it if possible.
Parameters:
Name Type Description
namespace string The namespace for the metrics.
metricName string The name of the metric.
dimensions json The dimensions for the metric.
unit string The unit for the metric.
value string The value for the metric.
aggregate bool If set to true, then the metric datum values will be aggregated. If there is already a matching metric datum with the same dimensions and namespace.
Source:

addNamespaceMetrics(namespace)

Adds a collection of metric datums to the buffer under the specified namespace.
Parameters:
Name Type Description
namespace string The namespace that the metrics should belong to.
Source:

addNamespaceMetricsCollection(namespace)

Adds a collection of metrics for a specific namespace. If the collection already exists, then it is ignored.
Parameters:
Name Type Description
namespace string The namespace which the collection of metrics belongs to.
Source:

addNewMetricDatum(namespace, metricName, dimensions, unit, value)

Adds a new metric datum to the buffer. This is done even if a matching one already exists within the buffer.
Parameters:
Name Type Description
namespace string The namespace for the metrics.
metricName string The name of the metric.
dimensions json The dimensions for the metric.
unit string The unit for the metric.
value string The value for the metric.
Source:

clearBuffer()

Clears the buffer of all metrics.
Source:

findMetricDatum(namespace, metricName, dimensions)

Finds a metric datum with the specified dimensions and namespace within the buffer. Null is returend if no metric datum exists with the specified crieria.
Parameters:
Name Type Description
namespace string The namespace that the metric datum belongs to.
metricName string The name of the metric.
dimensions * The dimensions of the mertic.
Source: