Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Don't double-format sysmon messages, unexport unused functions #237

wants to merge 1 commit into from

3 participants


This should more safely bound the memory used when printing lots of sysmon messages, as all the formatting is done via lager's trunc_io.


Pushed rebased version of this branch here.


+1 to merge. The rebased branch should merge cleanly, but careful if you merge this one there will be some conflicts.


Where do we need to merge this to for 1.3?


It only needs to be on master I think, but I don't see any harm in merging it to 1.2 as well.


@jaredmorrow Suggestions?


If it is dataloss I'd put to 1.2 also, otherwise just master.


Merged by hand to master.

@Vagabond Vagabond closed this
@seancribbs seancribbs deleted the adt-sysmon-format branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 10 deletions.
  1. +7 −10 src/riak_core_sysmon_handler.erl
17 src/riak_core_sysmon_handler.erl
@@ -26,9 +26,6 @@
%% API
-%% Perhaps useful to the outside world.
--export([format_pretty_proc_info/1, format_pretty_proc_info/2,
- get_pretty_proc_info/1, get_pretty_proc_info/2]).
%% gen_event callbacks
-export([init/1, handle_event/2, handle_call/2,
@@ -81,9 +78,9 @@ init([]) ->
%% @end
handle_event({monitor, Pid, Type, Info}, State) ->
- Pretty = format_pretty_proc_info(Pid, almost_current_function),
- lager:info("monitor ~w ~w ~s ~w",
- [Type, Pid, Pretty, Info]),
+ {Fmt, Args} = format_pretty_proc_info(Pid, almost_current_function),
+ lager:info("monitor ~w ~w "++ Fmt ++ " ~w",
+ [Type, Pid] ++ Args ++ [Info]),
{ok, State};
handle_event(Event, State) ->
lager:info("Monitor got ~p", [Event]),
@@ -161,13 +158,13 @@ format_pretty_proc_info(Pid, Acf) ->
case get_pretty_proc_info(Pid, Acf) of
undefined ->
- "";
+ {"", []};
Res ->
- io_lib:format("~w", [Res])
+ {"~w", [Res]}
catch X:Y ->
- io_lib:format("Pid ~w, ~W ~W at ~w\n",
- [Pid, X, 20, Y, 20, erlang:get_stacktrace()])
+ {"Pid ~w, ~W ~W at ~w\n",
+ [Pid, X, 20, Y, 20, erlang:get_stacktrace()]}
get_pretty_proc_info(Pid) ->
Something went wrong with that request. Please try again.