Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Check if error logger available before using it #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -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"}
]}.

Expand All @@ -18,7 +18,7 @@
,{test, [
{deps, [
{lager, "3.2.1"}
,{meck, "0.8.4"}
,{meck, "0.8.10"}
]}
]}
]}.
9 changes: 7 additions & 2 deletions src/dogstatsd_vm_stats.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down