<commit_before>import bunyan from 'bunyan';
import Promise from 'bluebird';
import SDC from 'statsd-client';

const logger = bunyan.createLogger({name: 'Stats'});

export default class Stats {
  constructor(config) {
    const stats = config.statsd;
    logger.info('Starting StatsD client.');
    this._statsd = new SDC({
      host: stats.host
    });
  }

  /**
   * Get the underlying stats client.
   * You should not rely on the type of this, only that it can be used
   * as a middleware for express.
   **/
  get client() {
    return this._statsd;
  }

  close() {
    this._statsd.close();
  }

  counter(name, value = 1) {
    logger.info('Updating counter %s by %s.', name, value);
    this._statsd.counter(name, value);
  }

  gauge(name, value) {
    logger.info('Gauging %s at %s.', name, value);
    this._statsd.gauge(name, value);
  }
}<commit_msg>Make stats quieter in logs.<commit_after>import bunyan from 'bunyan';
import Promise from 'bluebird';
import SDC from 'statsd-client';

const logger = bunyan.createLogger({name: 'Stats'});

export default class Stats {
  constructor(config) {
    const stats = config.statsd;
    logger.info('Starting StatsD client.');
    this._statsd = new SDC({
      host: stats.host
    });
  }

  /**
   * Get the underlying stats client.
   * You should not rely on the type of this, only that it can be used
   * as a middleware for express.
   **/
  get client() {
    return this._statsd;
  }

  close() {
    this._statsd.close();
  }

  counter(name, value = 1) {
    logger.debug('Updating counter %s by %s.', name, value);
    this._statsd.counter(name, value);
  }

  gauge(name, value) {
    logger.debug('Gauging %s at %s.', name, value);
    this._statsd.gauge(name, value);
  }
}
{'fraction_non_alphanumeric': 0.13787185354691076, 'fraction_numerical': 0.0011441647597254005, 'mean_word_length': 3.0299539170506913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4478634', 'n_tokens_mistral': 594, 'n_tokens_neox': 572, 'n_words': 174}