anchor.diff:                    )
               end
       end.
  -
  --spec monitor_per_dht_node(fun((pid_groups:groupname(), Idx::non_neg_integer()) -> any()),
  -                           [pid_groups:groupname(),...] | failed) -> non_neg_integer().
  -monitor_per_dht_node(F, Nodes) ->
  -    DHTNodes = lists:sort(Nodes),
  -    lists:foldl(fun (Group, Idx) ->
  -                        _ = F(Group, Idx),
  -                        Idx + 1
  -                end, 0, DHTNodes).
  -
  --spec fetch_rrd_metrics() -> list().
  -fetch_rrd_metrics() ->
  -    case pid_groups:pid_of("clients_group", monitor) of
  -        failed -> [];
  -        ClientMonitor ->
  -            case monitor:get_rrds(ClientMonitor, [{api_tx, 'req_list'}]) 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,
  -                            [{"tx latency", "float", Avg, "ms"},
  -                             {"transactions/s", "float", AvgPerS, "1/s"}];
  -                        _ -> []
  -                    end
  -            end
  -    end.
  -
  -% @doc aggregate the number of key-value pairs stored in this VM
  --spec fetch_local_load() -> list().
  -fetch_local_load() ->
  -    Pairs = lists:foldl(fun (Pid, Agg) ->
  -                                Agg + get_load(Pid)
  -                        end, 0, pid_groups:find_all(dht_node)),
  -    [{"kv pairs", "int32", Pairs, "pairs"}].
   
   % @doc get number of key-value pairs stored in given node
   -spec get_load(Pid::comm:erl_local_pid()) -> integer().
  
positive.code:     _ = gmetric(both, "Memory used by atoms", "int32", erlang:memory(atom), "Bytes"),
      _ = gmetric(both, "Memory used by binaries", "int32", erlang:memory(binary), "Bytes"),
      _ = gmetric(both, "Memory used by system", "int32", erlang:memory(system), "Bytes"),
      DHTNodesMemoryUsage = lists:sum([element(2, erlang:process_info(P, memory))
                                      || P <- pid_groups:find_all(dht_node)]),
      _ = gmetric(both, "Memory used by dht_nodes", "int32", DHTNodesMemoryUsage, "Bytes"),
      % Statistics in RRD (Load, Latency)
      RRDMetrics = fetch_rrd_metrics(),
      _ = case RRDMetrics of
              [] -> ok;
              _  ->  _ = [gmetric(both, Metric, Type, Value, Unit) || {Metric, Type, Value, Unit} <- RRDMetrics],
                     ok
          end,
      % Local Load
      LocalLoad = fetch_local_load(),
      _ = [gmetric(both, Metric, Type, Value, Unit) || {Metric, Type, Value, Unit} <- LocalLoad],
      % vivaldi statistics
      monitor_per_dht_node(fun monitor_vivaldi_errors/2, pid_groups:groups_with(dht_node)),
      set_last_active(State).
  
  
  -spec traverse(received | sent, Iter1::term()) -> ok.
  traverse(RcvSnd, Iter1) ->
  
negative.code: -spec on(message(), state()) -> state().
  on({ganglia_trigger}, {LastActive, TriggerOld}) ->
      Trigger = trigger:next(TriggerOld),
      gen_component:post_op(_State = {LastActive, Trigger}, _Message = {ganglia_periodic});
  
  on({ganglia_periodic}, State) ->
      send_general_metrics(),
      send_dht_node_metrics(),
      send_message_metrics(),
      send_rrd_metrics(),
      send_vivaldi_errors(),
      set_last_active(State).
  
  send_general_metrics() ->
      % general erlang status information
      _ = gmetric(both, "Erlang Processes", "int32", erlang:system_info(process_count), "Total Number"),
      _ = gmetric(both, "Memory used by Erlang processes", "int32", erlang:memory(processes_used), "Bytes"),
  