How to use the ember-metrics/services/metrics.extend function in ember-metrics

To help you get started, we’ve selected a few ember-metrics 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 hummingbird-me / hummingbird-client / app / services / metrics.js View on Github external
import MetricsService from 'ember-metrics/services/metrics';
import { inject as service } from '@ember/service';
import Config from 'client/config/environment';

export default MetricsService.extend({
  router: service(),

  /**
   * Support providing `staging` in the `environments` array for a metric adapter.
   */
  _filterEnvironments(adapterOption, appEnvironment) {
    let environment = appEnvironment;
    if (environment === 'production' && Config.kitsu.isStaging) {
      environment = 'staging';
    }
    return this._super(adapterOption, environment);
  }
});

ember-metrics

Send data to multiple analytics integrations without re-implementing new API

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis