<commit_before>StatsD InfluxDB backend
-----------------------

A naive [InfluxDB](http://influxdb.org/) backend for
[StatsD](https://github.com/etsy/statsd).

It can ship events to InfluxDB using two different strategies which can be
used at the same time.

### Regular Flush Strategy

StatsD will flush aggregated metrics with a configured interval. This is
the regular StatsD mode of operation.

### Proxy Strategy

This will map every incoming StatsD packet to an InfluxDB event. It's useful
if you want to store the raw events in InfluxDB without any rollups.

## CAVEATS

This is pretty young and I do not have much experience with InfluxDB yet.
Especially the event buffering and the event mapping might be problematic
and inefficient.

InfluxDB is also pretty young and there might be breaking changes until it
reaches 1.0.

Please be careful!

## Installation

    $ cd /path/to/statsd
    $ npm install statsd-influxdb-backend

## Configuration

You can configure the following settings in your StatsD config file.

```js
{
  graphitePort: 2003,
  graphiteHost: "graphite.example.com",
  port: 8125,
  backends: [ "./backends/graphite", "statsd-influxdb-backend" ],

  influxdb: {
    host: '127.0.0.1',   // InfluxDB host. (default 127.0.0.1)
    port: 8086,          // InfluxDB port. (default 8086)
    version: 0.8,        // InfluxDB port. (default 0.8)
    ssl: false,          // InfluxDB is hosted over SSL. (default false)
    database: 'dbname',  // InfluxDB database instance. (required)
    username: 'user',    // InfluxDB database username.
    password: '<PASSWORD>',    // InfluxDB database password.
    flush: {
      enable: true       // Enable regular flush strategy. (default true)
    },
    proxy: {
      enable: false,       // Enable the proxy strategy. (default false)
      suffix: 'raw',       // Metric name suffix. (default 'raw')
      flushInterval: 1000  // Flush interval for the internal buffer.
                           // (default 1000)
    },
    includeStatsdMetrics: false, // Send internal statsd metrics to InfluxDB. (default false)
    includeInfluxdbMetrics: false // Send internal backend metrics to InfluxDB. (default false)
                                  // Requires includeStatsdMetrics to be enabled.
  }
}
```

## Activation

Add the `statsd-influxdb-backend` to the list of StatsD backends in the config
file and restart the StatsD process.
<commit_msg>Fixed a typo<commit_after>StatsD InfluxDB backend
-----------------------

A naive [InfluxDB](http://influxdb.org/) backend for
[StatsD](https://github.com/etsy/statsd).

It can ship events to InfluxDB using two different strategies which can be
used at the same time.

### Regular Flush Strategy

StatsD will flush aggregated metrics with a configured interval. This is
the regular StatsD mode of operation.

### Proxy Strategy

This will map every incoming StatsD packet to an InfluxDB event. It's useful
if you want to store the raw events in InfluxDB without any rollups.

## CAVEATS

This is pretty young and I do not have much experience with InfluxDB yet.
Especially the event buffering and the event mapping might be problematic
and inefficient.

InfluxDB is also pretty young and there might be breaking changes until it
reaches 1.0.

Please be careful!

## Installation

    $ cd /path/to/statsd
    $ npm install statsd-influxdb-backend

## Configuration

You can configure the following settings in your StatsD config file.

```js
{
  graphitePort: 2003,
  graphiteHost: "graphite.example.com",
  port: 8125,
  backends: [ "./backends/graphite", "statsd-influxdb-backend" ],

  influxdb: {
    host: '127.0.0.1',   // InfluxDB host. (default 127.0.0.1)
    port: 8086,          // InfluxDB port. (default 8086)
    version: 0.8,        // InfluxDB version. (default 0.8)
    ssl: false,          // InfluxDB is hosted over SSL. (default false)
    database: 'dbname',  // InfluxDB database instance. (required)
    username: 'user',    // InfluxDB database username.
    password: '<PASSWORD>',    // InfluxDB database password.
    flush: {
      enable: true       // Enable regular flush strategy. (default true)
    },
    proxy: {
      enable: false,       // Enable the proxy strategy. (default false)
      suffix: 'raw',       // Metric name suffix. (default 'raw')
      flushInterval: 1000  // Flush interval for the internal buffer.
                           // (default 1000)
    },
    includeStatsdMetrics: false, // Send internal statsd metrics to InfluxDB. (default false)
    includeInfluxdbMetrics: false // Send internal backend metrics to InfluxDB. (default false)
                                  // Requires includeStatsdMetrics to be enabled.
  }
}
```

## Activation

Add the `statsd-influxdb-backend` to the list of StatsD backends in the config
file and restart the StatsD process.

{'fraction_non_alphanumeric': 0.09826589595375723, 'fraction_numerical': 0.017341040462427744, 'mean_word_length': 2.7470997679814384, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5944526', 'n_tokens_mistral': 1492, 'n_tokens_neox': 1359, 'n_words': 546}