anchor.diff:      send_vivaldi_errors(),
       set_last_active(NewState);
   
  -% @doc aggregates load information from the dht nodes
  +% @doc aggregates load information from the dht nodes and
  +%      and sends it out to ganglia if all nodes have replied
   on({ganglia_dht_load_aggregation, PID, AggId, Msg}, State) ->
       ?TRACE("~p: ~p~n", [AggId, Msg]),
       % all went well, we no longer need the failure detector
  
positive.code:         true -> State
      end;
  
  % @doc handler for message from failure detector
  %      if a node crashes before sending out the load data
  %      we ignore its load information
  on({crash, _PID, {ganglia, AggId}}, State) ->
  
negative.code:         true ->
              State
      end;
  
  % @doc receives requested latency and transactions/s
  %      rrd data from the monitor and sends it to Ganglia
  on({get_rrds_response, Response}, State) ->
      RRDMetrics =
          case Response of
              [{_,_, undefined}] -> [];
              [{_, _, RRD}] ->
                  case rrd:dump(RRD) of
                      [H | _] ->
                      {From_, To_, Value} = H,
                          Diff_in_s = timer:now_diff(To_, From_) div 1000000,
                          {Sum, _Sum2, Count, _Min, _Max, _Hist} = Value,
                          AvgPerS = Count / Diff_in_s,
                          Avg = Sum / Count,
                          [{both, "tx latency", "float", Avg, "ms"},
                           {both, "transactions/s", "float", AvgPerS, "1/s"}];
                      _ -> []
                  end
          end,
      gmetric(RRDMetrics),
      State;
  
  % @doc handler for messages from the vivaldi process
  %      reporting its confidence
  