Packages

Push your erlang runtime metrics using ferd/vmstats to your StatsD server

Current section

Files

Jump to
vmstats_ex lib vmstats_ex sink.ex
Raw

lib/vmstats_ex/sink.ex

defmodule VmstatsEx.Sink do
@behaviour :vmstats_sink
# From https://github.com/ferd/vmstats#vmstats_sink-behaviour
# -callback collect(Type :: counter | gauge | timing,
# Key :: iodata(),
# Value :: term()) -> ok.
def collect(type, key, value) when is_number(value) do
apply(VmstatsEx.Statix, translate_type(type), [key, value])
end
defp translate_type(:counter), do: :increment
defp translate_type(type), do: type
end