woody v0.2.0 Woody.StatsD
Settings are taken from the ex_statsd
application configuration.
The following are used to connect to your statsd server:
host
: The hostname or IP address (default: 127.0.0.1)port
: The port number (default: 8125)
You can also provide an optional namespace
to automatically nest all
stats.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor
Record the Enum.count/1 of an enumerable
Record a counter metric
Record a decrement to a counter metric
Ensure the metrics are sent
Record a gauge entry
Record a histogram value (DogStatsD-only)
Time a function using a histogram metric (DogStatsD-only)
Record an increment to a counter metric
Record a set metric
Start the server
Stop the server
Record a timer metric
Measure a function call
Link to this section Types
host()
host() :: String.t()
host() :: String.t()
name()
name() :: String.t()
name() :: String.t()
namespace()
namespace() :: String.t()
namespace() :: String.t()
options()
sink()
sink() :: String.t()
sink() :: String.t()
statsd_port()
statsd_port() :: number()
statsd_port() :: number()
tags()
tags() :: [String.t()]
tags() :: [String.t()]
Link to this section Functions
child_spec(arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
count(collection, metric, options \\ default_options())
Record the Enum.count/1 of an enumerable.
sample_rate
: Limit how often the metric is collectedtags
: Add tags to entry (DogStatsD-only)
It returns the collection given as its first argument, making it suitable for pipelining.
counter(amount, metric, options \\ default_options())
Record a counter metric.
sample_rate
: Limit how often the metric is collectedtags
: Add tags to entry (DogStatsD-only)
It returns the amount given as its first argument, making it suitable for pipelining.
decrement(metric, options \\ default_options())
Record a decrement to a counter metric.
sample_rate
: Limit how often the metric is collectedtags
: Add tags to entry (DogStatsD-only)
Returns nil
.
event(title, text \\ "", options \\ [tags: []])
Emit event.
text
supports line breaks, only first 4KB will be transmitted.
Available options:
tags
: Add tags to entry (DogStatsD-only)priority
: Can be normal or low, default normalalert_type
: Can be error, warning, info or success, default infoaggregation_key
: Assign an aggregation key to the event, to group it with some othershostname
: Assign a hostname to the eventsource_type_name
: Assign a source type to the eventdate_happened
: Assign a timestamp to the event, default current time
It returns the title of the event, making it suitable for pipelining.
flush(name \\ __MODULE__)
Ensure the metrics are sent.
gauge(amount, metric, options \\ [tags: []])
Record a gauge entry.
tags
: Add tags to entry (DogStatsD-only)
It returns the amount given as its first argument, making it suitable for pipelining.
histogram(amount, metric, options \\ default_options())
Record a histogram value (DogStatsD-only).
sample_rate
: Limit how often the metric is collectedtags
: Add tags to entry (DogStatsD-only)
It returns the value given as the first argument, making it suitable for pipelining.
histogram_timing(metric, fun, options \\ default_options())
Time a function using a histogram metric (DogStatsD-only).
sample_rate
: Limit how often the metric is collectedtags
: Add tags to entry (DogStatsD-only)
It returns the result of the function call, making it suitable for pipelining.
increment(metric, options \\ default_options())
Record an increment to a counter metric.
sample_rate
: Limit how often the metric is collectedtags
: Add tags to entry (DogStatsD-only)
Returns nil
.
set(member, metric, options \\ [tags: []])
Record a set metric.
tags
: Add tags to entry (DogStatsD-only)
It returns the value given as its first argument, making it suitable for pipelining.
start_link(options \\ [])
Start the server.
stop(name \\ __MODULE__)
Stop the server.
timer(amount, metric, options \\ default_options())
Record a timer metric.
sample_rate
: Limit how often the metric is collectedtags
: Add tags to entry (DogStatsD-only)
It returns the value given as its first argument, making it suitable for pipelining.
timing(metric, fun, options \\ default_options())
Measure a function call.
sample_rate
: Limit how often the metric is collectedtags
: Add tags to entry (DogStatsD-only)
It returns the result of the function call, making it suitable for pipelining.