How to use the measured-core.MetricTypes.TIMER 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-signalfx-reporter / lib / reporters / SignalFxMetricsReporter.js View on Github external
_getValuesToProcessForType(name, metric) {
    const type = metric.getType();
    switch (type) {
      case MetricTypes.TIMER:
        return this._getValuesToProcessForTimer(name, metric);
      case MetricTypes.GAUGE:
        return this._getValuesToProcessForGauge(name, metric);
      case MetricTypes.COUNTER:
        return this._getValuesToProcessForCounter(name, metric);
      case MetricTypes.HISTOGRAM:
        return this._getValuesToProcessForHistogram(name, metric);
      case MetricTypes.METER:
        this._log.warn(
          'Meters are not reported to SignalFx. Meters do not make sense to use with SignalFx because the same values ' +
            'can be calculated using simple counters and aggregations within SignalFx itself.'
        );
        return [];
      default:
        this._log.error(`Metric Type: ${type} has not been implemented to report to signal fx`);
        return [];