How to use the measured-core.metricValidators function in measured-core

To help you get started, we’ve selected a few measured-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yaorg / node-measured / packages / measured-reporting / lib / validators / inputValidators.js View on Github external
const Optional = require('optional-js');
const { validateMetric } = require('measured-core').metricValidators;

/**
 * This module contains various validators to validate publicly exposed input.
 *
 * @module inputValidators
 */
module.exports = {
  /**
   * Validates @{link Gauge} options.
   *
   * @param {string} name The metric name
   * @param {function} callback The callback for the Gauge
   * @param {Dimensions} dimensions The optional custom dimensions
   * @param {number} publishingIntervalInSeconds the optional publishing interval
   */
  validateGaugeOptions: (name, callback, dimensions, publishingIntervalInSeconds) => {