dogstatsd-elixir
dogstatsd-elixir copied to clipboard
Return the value from the function in batch/2
Since batch/2 is intended to buffer requests, returning the return value of the passed function can be handy in use cases like the example below, where we care for the return value.
map = DogStatsd.batch statsd, fn (statsd) ->
for i <- 1..10_000, into: %{}, do
s.increment(statsd, "numbers")
{"key_#{i}", i}
end
end
some_function(map)