anchor.diff: +%% -------------------------------------------------------------------
  +%%
  +%% riak_kv_get_put_monitor:  Oberserve and stat log get/put fsm's
  +%%
  +%% Copyright (c) 2007-2010 Basho Technologies, Inc.  All Rights Reserved.
  +%%
  +%% This file is provided to you under the Apache License,
  +%% Version 2.0 (the "License"); you may not use this file
  +%% except in compliance with the License.  You may obtain
  +%% a copy of the License at
  +%%
  +%%   http://www.apache.org/licenses/LICENSE-2.0
  +%%
  +%% Unless required by applicable law or agreed to in writing,
  +%% software distributed under the License is distributed on an
  +%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  +%% KIND, either express or implied.  See the License for the
  +%% specific language governing permissions and limitations
  +%% under the License.
  +%%
  +%% -------------------------------------------------------------------
  +
  +%% @doc Monitor reporting processes and notify folsom about live and error
  +%% exits. It is up to the fsm to report it's existence to the monitor. If this
  +%% module exits unexpectadly, the stats in folsom are not lost; a clean exit
  +%% will reset the stats.
  +%%
  +%% The stats tracked are:
  +%% * put_fsm_in_progress: a counter of the number of put fsm's current running.
  +%% * get_fsm_in_progress: as above, but for get fsm's.
  +%% * put_fsm_errors_minute: a spiral metric of the put fsm's that have exited 
  +%% for a reason other than shutdown or normal.
  +%% * get_fsm_errors_minute: as above, but for get fsm's.
  +%% * put_fsm_errors_since_start: a count of all put fsm's that have exited for
  +%% a reason other than shutdown or normal since the folsom stat was created.
  +%% * get_fsm_errors_since_start: as above, but for get fsm's.
  +
   -module(riak_kv_get_put_monitor).
   -behaviour(gen_server).
   -define(SERVER, ?MODULE).
  
positive.code:     folsom_metrics:new_counter(get_fsm_errors_since_start),
      {ok, #state{}}.
  
  handle_call(dump_state, _From, State) ->
      {reply, State, State};
  
  handle_call(_Request, _From, State) ->
      {reply, ok, State}.
  
  handle_cast({get_fsm_spawned, Pid}, State) ->
      #state{monitor_list = List} = State,
      List2 = insert_pid(Pid, get, List),
  
negative.code: 	[folsom_metrics:delete_metric(Counter) || Counter <- Counters],
      ok.
  
  %% @private
  code_change(_OldVsn, State, _Extra) ->
      {ok, State}.
  
  