This module contains various validators to validate publicly exposed input.
Methods
-
<static> validateCachedGaugeOptions(name, callback, dimensions, publishingIntervalInSeconds)
-
Validates @{link Gauge} options.
Parameters:
Name Type Description name
string The metric name
callback
function The callback for the CachedGauge
dimensions
Dimensions The optional custom dimensions
publishingIntervalInSeconds
number the optional publishing interval
-
<static> validateCommonMetricParameters(name, dimensions, publishingIntervalInSeconds)
-
Validates the options that are common amoung all create metric methods
Parameters:
Name Type Description name
string The metric name
dimensions
Dimensions The optional custom dimensions
publishingIntervalInSeconds
number the optional publishing interval
-
<static> validateCounterOptions(name, dimensions, publishingIntervalInSeconds)
-
Validates the create counter Options.
Parameters:
Name Type Description name
string The metric name
dimensions
Dimensions The optional custom dimensions
publishingIntervalInSeconds
number the optional publishing interval
-
<static> validateGaugeOptions(name, callback, dimensions, publishingIntervalInSeconds)
-
Validates @{link Gauge} options.
Parameters:
Name Type Description name
string The metric name
callback
function The callback for the Gauge
dimensions
Dimensions The optional custom dimensions
publishingIntervalInSeconds
number the optional publishing interval
-
<static> validateHistogramOptions(name, dimensions, publishingIntervalInSeconds)
-
Validates the create histogram Options.
Parameters:
Name Type Description name
string The metric name
dimensions
Dimensions The optional custom dimensions
publishingIntervalInSeconds
number the optional publishing interval
-
<static> validateMetricName(name)
-
Validates the metric name.
Parameters:
Name Type Description name
The metric name.
-
<static> validateNumberReturningCallback(callback)
-
Validates the provided callback.
Parameters:
Name Type Description callback
The provided callback for a gauge.
-
<static> validateOptionalDimensions(dimensionsOptional)
-
Validates a set of optional dimensions
Parameters:
Name Type Description dimensionsOptional
-
<static> validateOptionalLogger(loggerOptional)
-
Validates that an optional logger instance at least has the methods we expect.
Parameters:
Name Type Description loggerOptional
-
<static> validateOptionalPublishingInterval(publishingIntervalInSecondsOptional)
-
Validates the optional publishing interval.
Parameters:
Name Type Description publishingIntervalInSecondsOptional
The optional publishing interval.
-
<static> validateRegisterOptions(name, metric, dimensions, publishingIntervalInSeconds)
-
Validates the create timer Options.
Parameters:
Name Type Description name
string The metric name
metric
Metric The metric instance
dimensions
Dimensions The optional custom dimensions
publishingIntervalInSeconds
number the optional publishing interval
-
<static> validateReporterInstance(reporter)
-
Validates that a valid Reporter object has been supplied
Parameters:
Name Type Description reporter
Reporter -
<static> validateReporterParameters(options)
-
Validates optional params for a Reporter
Parameters:
Name Type Description options
ReporterOptions The optional params
-
<static> validateSelfReportingMetricsRegistryParameters(reporters [, options])
-
Validates the input parameters for a SelfReportingMetricsRegistry
Parameters:
Name Type Argument Description reporters
Array.<Reporter> options
SelfReportingMetricsRegistryOptions <optional>
-
<static> validateSettableGaugeOptions(name, dimensions, publishingIntervalInSeconds)
-
Validates the create settable gauge Options.
Parameters:
Name Type Description name
string The metric name
dimensions
Dimensions The optional custom dimensions
publishingIntervalInSeconds
number the optional publishing interval
-
<static> validateTimerOptions(name, dimensions, publishingIntervalInSeconds)
-
Validates the create timer Options.
Parameters:
Name Type Description name
string The metric name
dimensions
Dimensions The optional custom dimensions
publishingIntervalInSeconds
number the optional publishing interval
-
<inner> validateMetric(metric)
-
Validates that a metric implements the metric interface.
Parameters:
Name Type Description metric
Metric The object that is supposed to be a metric.