anchor.diff:  do_get_bucket(true, {Bucket, Microsecs, Stages, NumSiblings, ObjSize, Type}=Args) ->
       case (catch folsom_metrics:notify_existing_metric({?APP, node, gets, Type, Bucket}, 1, spiral)) of
           ok ->
  -            [folsom_metrics:notify_existing_metric({?APP, node, gets, Type, Dimension, Bucket}, Arg, histogram)
  +            _ = [ok = folsom_metrics:notify_existing_metric({?APP, node, gets, Type, Dimension, Bucket}, Arg, histogram)
                || {Dimension, Arg} <- [{time, Microsecs},
                                        {siblings, NumSiblings},
                                        {objsize, ObjSize}], Arg /= undefined],
  
positive.code: do_put_bucket(true, {Bucket, Microsecs, Stages}=Args) ->
      case (catch folsom_metrics:notify_existing_metric({?APP, node, puts, Bucket}, 1, spiral)) of
          ok ->
              folsom_metrics:notify_existing_metric({?APP, node, puts, time, Bucket}, Microsecs, histogram),
              do_stages([?APP, node, puts, time, Bucket], Stages);
          {'EXIT', _} ->
              register_stat({?APP, node, puts, Bucket}, spiral),
  
negative.code: 
  %% @doc Update the given stat
  do_update({vnode_get, Idx, USecs}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, vnode, gets}, 1, spiral),
      create_or_update({?APP, vnode, gets, time}, USecs, histogram),
      do_per_index(gets, Idx, USecs);
  do_update({vnode_put, Idx, USecs}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, vnode, puts}, 1, spiral),
      create_or_update({?APP, vnode, puts, time}, USecs, histogram),
      do_per_index(puts, Idx, USecs);
  do_update(vnode_index_refresh) ->
      ok = folsom_metrics:notify_existing_metric({?APP, vnode, index, refreshes}, 1, spiral);
  do_update(vnode_index_read) ->
      folsom_metrics:notify_existing_metric({?APP, vnode, index, reads}, 1, spiral);
  do_update({vnode_index_write, PostingsAdded, PostingsRemoved}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, vnode, index, writes}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, vnode, index, writes, postings}, PostingsAdded, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, vnode, index, deletes, postings}, PostingsRemoved, spiral);
  do_update({vnode_index_delete, Postings}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, vnode, index, deletes}, Postings, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, vnode, index, deletes, postings}, Postings, spiral);
  do_update({vnode_dt_update, Mod, Micros}) ->
      Type = riak_kv_crdt:from_mod(Mod),
      ok = folsom_metrics:notify_existing_metric({?APP, vnode, Type, update}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, vnode, Type, update, time}, Micros, histogram);
  do_update({riak_object_merge, undefined,  Micros}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, object, merge}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, object, merge, time}, Micros, histogram);
  do_update({riak_object_merge, Mod, Micros}) ->
      Type = riak_kv_crdt:from_mod(Mod),
      ok = folsom_metrics:notify_existing_metric({?APP, object, Type, merge}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, object, Type, merge, time}, Micros, histogram);
  do_update({get_fsm, Bucket, Microsecs, Stages, undefined, undefined, PerBucket, undefined}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets, time}, Microsecs, histogram),
      do_stages([?APP, node, gets, time], Stages),
      do_get_bucket(PerBucket, {Bucket, Microsecs, Stages, undefined, undefined});
  do_update({get_fsm, Bucket, Microsecs, Stages, NumSiblings, ObjSize, PerBucket, undefined}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets, time}, Microsecs, histogram),
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets, siblings}, NumSiblings, histogram),
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets, objsize}, ObjSize, histogram),
      do_stages([?APP, node, gets, time], Stages),
      do_get_bucket(PerBucket, {Bucket, Microsecs, Stages, NumSiblings, ObjSize});
  do_update({get_fsm, Bucket, Microsecs, Stages, undefined, undefined, PerBucket, CRDTMod}) ->
      Type = riak_kv_crdt:from_mod(CRDTMod),
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets, Type}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets, Type, time}, Microsecs, histogram),
      do_stages([?APP, node, gets, Type, time], Stages),
      do_get_bucket(PerBucket, {Bucket, Microsecs, Stages, undefined, undefined, Type});
  do_update({get_fsm, Bucket, Microsecs, Stages, NumSiblings, ObjSize, PerBucket, CRDTMod}) ->
      Type = riak_kv_crdt:from_mod(CRDTMod),
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets, Type}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets, Type, time}, Microsecs, histogram),
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets, Type, siblings}, NumSiblings, histogram),
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets, Type, objsize}, ObjSize, histogram),
      do_stages([?APP, node, gets, Type, time], Stages),
      do_get_bucket(PerBucket, {Bucket, Microsecs, Stages, NumSiblings, ObjSize, Type});
  do_update({put_fsm_time, Bucket,  Microsecs, Stages, PerBucket, undefined}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, node, puts}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, node, puts, time}, Microsecs, histogram),
      do_stages([?APP, node, puts, time], Stages),
      do_put_bucket(PerBucket, {Bucket, Microsecs, Stages});
  do_update({put_fsm_time, Bucket,  Microsecs, Stages, PerBucket, CRDTMod}) ->
      Type = riak_kv_crdt:from_mod(CRDTMod),
      ok = folsom_metrics:notify_existing_metric({?APP, node, puts, Type}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, node, puts, Type, time}, Microsecs, histogram),
      do_stages([?APP, node, puts, Type, time], Stages),
      do_put_bucket(PerBucket, {Bucket, Microsecs, Stages, Type});
  do_update({read_repairs, Indices, Preflist}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, node, gets, read_repairs}, 1, spiral),
      do_repairs(Indices, Preflist);
  do_update(coord_redir) ->
      ok = folsom_metrics:notify_existing_metric({?APP, node, puts, coord_redirs}, {inc, 1}, counter);
  do_update(mapper_start) ->
      ok = folsom_metrics:notify_existing_metric({?APP, mapper_count}, {inc, 1}, counter);
  do_update(mapper_end) ->
      ok = folsom_metrics:notify_existing_metric({?APP, mapper_count}, {dec, 1}, counter);
  do_update(precommit_fail) ->
      ok = folsom_metrics:notify_existing_metric({?APP, precommit_fail}, {inc, 1}, counter);
  do_update(postcommit_fail) ->
      ok = folsom_metrics:notify_existing_metric({?APP, postcommit_fail}, {inc, 1}, counter);
  do_update({fsm_spawned, Type}) when Type =:= gets; Type =:= puts ->
      ok = folsom_metrics:notify_existing_metric({?APP, node, Type, fsm, active}, {inc, 1}, counter);
  do_update({fsm_exit, Type}) when Type =:= gets; Type =:= puts  ->
      ok = folsom_metrics:notify_existing_metric({?APP, node, Type, fsm,  active}, {dec, 1}, counter);
  do_update({fsm_error, Type}) when Type =:= gets; Type =:= puts ->
      do_update({fsm_exit, Type}),
      ok = folsom_metrics:notify_existing_metric({?APP, node, Type, fsm, errors}, 1, spiral);
  do_update({index_create, Pid}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, index, fsm, create}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, index, fsm, active}, {inc, 1}, counter),
      add_monitor(index, Pid),
      ok;
  do_update(index_create_error) ->
      ok = folsom_metrics:notify_existing_metric({?APP, index, fsm, create, error}, 1, spiral);
  do_update({list_create, Pid}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, list, fsm, create}, 1, spiral),
      ok = folsom_metrics:notify_existing_metric({?APP, list, fsm, active}, {inc, 1}, counter),
      add_monitor(list, Pid),
      ok;
  do_update(list_create_error) ->
      ok = folsom_metrics:notify_existing_metric({?APP, list, fsm, create, error}, 1, spiral);
  do_update({fsm_destroy, Type}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, Type, fsm, active}, {dec, 1}, counter);
  do_update({Type, actor_count, Count}) ->
      ok = folsom_metrics:notify_existing_metric({?APP, Type, actor_count}, Count, histogram).
  
  %% private
  
  