diff --git a/rebar.config b/rebar.config index 28546b3..2cb7f6d 100644 --- a/rebar.config +++ b/rebar.config @@ -1,7 +1,7 @@ %%% -*- mode: erlang; -*- {erl_opts, [debug_info]}. {deps, [ - {worker_pool, "2.1.0"} + {worker_pool, "3.0.0"} ,{stillir, "1.0.0"} ]}. @@ -18,7 +18,7 @@ ,{test, [ {deps, [ {lager, "3.2.1"} - ,{meck, "0.8.4"} + ,{meck, "0.8.10"} ]} ]} ]}. diff --git a/src/dogstatsd_vm_stats.erl b/src/dogstatsd_vm_stats.erl index 8b2041f..850a59a 100644 --- a/src/dogstatsd_vm_stats.erl +++ b/src/dogstatsd_vm_stats.erl @@ -122,8 +122,13 @@ handle_info({timeout, R, ?TIMER_MSG}, S = #state{key=K, delay=D, timer_ref=R}) - dogstatsd:gauge([K,"run_queue"], erlang:statistics(run_queue), 1.00), %% Error logger backlog (lower is better) - {_, MQL} = process_info(whereis(error_logger), message_queue_len), - dogstatsd:gauge([K,"error_logger_queue_len"], MQL, 1.00), + + case whereis(error_logger) of + undefined -> undefined; + Pid -> + {_, MQL} = process_info(Pid, message_queue_len), + dogstatsd:gauge([K,"error_logger_queue_len"], MQL, 1.00) + end, %% Memory usage. There are more options available, but not all were kept. %% Memory usage is in bytes.