module Datadog

Datadog::Statsd: A DogStatsd client (www.datadoghq.com)

@example Set up a global Statsd client for a server on localhost:8125

require 'datadog/statsd'
$statsd = Datadog::Statsd.new 'localhost', 8125

@example Send some stats

$statsd.increment 'page.views'
$statsd.timing 'page.load', 320
$statsd.gauge 'users.online', 100

@example Use {#time} to time the execution of a block

$statsd.time('account.activate') { @account.activate! }

@example Create a namespaced statsd client and increment ‘account.activate’

statsd = Datadog::Statsd.new 'localhost', 8125, :namespace => 'account'
statsd.increment 'activate'

@example Create a statsd client with global tags

statsd = Datadog::Statsd.new 'localhost', 8125, tags: 'tag1:true'

require ‘forwardable’