anchor.diff:  -behaviour(gen_server).
   -define(SERVER, ?MODULE).
   
  --record(state, {gets = [], puts = []}).
  +-record(state, {monitor_list = []}).
   
   %% ------------------------------------------------------------------
   %% API Function Exports
  
positive.code: %% Internal Function Definitions
  %% ------------------------------------------------------------------
  
  insert_pid(Pid, List) ->
      MonRef = erlang:monitor(process, Pid),
      orddict:store(MonRef, Pid, List).
  
negative.code: %% ------------------------------------------------------------------
  
  init([]) ->
      folsom_metrics:new_spiral(put_fsm_in_progress),
      folsom_metrics:new_spiral(get_fsm_in_progress),
      folsom_metrics:new_spiral(put_fsm_errors),
      folsom_metrics:new_spiral(get_fsm_errors),
      {ok, #state{}}.
  
  handle_call(_Request, _From, State) ->
      {reply, ok, State}.
  
  handle_cast({get_fsm_spawned, Pid}, State) ->
      #state{monitor_list = MonList} = State,
      List2 = insert_pid(Pid, get, MonList),
      folsom_metrics:notify({get_fsm_in_progress, 1}),
      {noreply, State#state{monitor_list = List2}};
  
  handle_cast({put_fsm_spawned, Pid}, State) ->
      #state{monitor_list = List} = State,
      List2 = insert_pid(Pid, put, List),
      folsom_metrics:notify({put_fsm_in_process, 1}),
      {noreply, State#state{monitor_list = List2}};
  
  handle_cast(stop, State) ->
      {stop, normal, State};
  
  handle_cast(_Msg, State) ->
      {noreply, State}.
  
  handle_info({'DOWN', MonRef, process, Pid, Cause}, State) ->
      #state{monitor_list = MonList} = State,
      case orddict_get_erase(MonRef, MonList) of
          undefined ->
              % meh, likely a late message
              {noreply, State};
          {{Pid, Type}, MonList2} ->
              tell_folsom_about_exit(Type, Cause),
              {noreply, State#state{monitor_list = MonList2}}
      end;
  
  handle_info(_Info, State) ->
      {noreply, State}.
  