ex-stats-tracker

Statsd Client for Elixir. ExStatsTracker is a process based statsd client that supports batch stat flushes to avoid fd exhaustion.

Installation

  1. Add ex-stats-tracker to your list of dependencies in mix.exs:
def deps do
  [{:ex_stats_tracker, "~> 0.1.0"}]
end
  1. Ensure ex_stats_tracker is started before your application:
def application do
  [extra_applications: [:ex_stats_tracker]]
end

Configuration

Configure ex_stats_tracker in config:

use Mix.Config

config :ex_stats_tracker,
       host: "your.statsd.host.com",
       port: 1234,
       prefix: "your_prefix"
       flush_interval: 10000
       chunk_size: 20

The defaults are:

Usage

iex> ExStatsTracker.counter(your_key, 1)
iex> ExStatsTracker.increment(your_key)
iex> ExStatsTracker.gauge(your_key)
iex> ExStatsTracker.timing(your_metric, 1)
iex> ExStatsTracker.histogram(your_metric, 1)
iex> ExStatsTracker.meter(your_metric, 1)