anchor.diff:       {node_put_fsm_time_99, PutNN},
        {node_put_fsm_time_100, PutH}].
   
  +%% @spec cpu_stats() -> proplist()
  +%% @doc Get stats on the cpu, as given by the cpu_sup module
  +%%      of the os_mon application.
   cpu_stats() ->
       [{cpu_nprocs, cpu_sup:nprocs()},
        {cpu_avg1, cpu_sup:avg1()},
        {cpu_avg5, cpu_sup:avg5()},
        {cpu_avg15, cpu_sup:avg15()}].
   
  +%% @spec mem_stats() -> proplist()
  +%% @doc Get stats on the memory, as given by the memsup module
  +%%      of the os_mon application.
   mem_stats() ->
       {Total, Alloc, _} = memsup:get_memory_data(),
       [{mem_total, Total},
        {mem_allocated, Alloc}].
   
  +%% @spec disk_stats() -> proplist()
  +%% @doc Get stats on the disk, as given by the disksup module
  +%%      of the os_mon application.
   disk_stats() ->
       [{disk, disksup:get_disk_data()}].
  
positive.code: update(_, _, State) ->
      State.
  
  spiral_incr(Elt, Moment, State) ->
      setelement(Elt, State,
                 spiraltime:incr(1, Moment, element(Elt, State))).
  
  slide_incr(Elt, Reading, Moment, State) ->
      setelement(Elt, State,
                 slide:update(element(Elt, State), Reading, Moment)).
  
  produce_stats(State) ->
      Moment = spiraltime:n(),
      lists:append(
  
negative.code:        mem_stats(),
         disk_stats()]).
  
  %% @spec spiral_minute(integer(), integer(), state()) -> integer()
  %% @doc Get the count of events in the last minute from the spiraltime
  %%      structure at the given element of the state tuple.
  spiral_minute(Moment, Elt, State) ->
      Up = spiraltime:incr(0, Moment, element(Elt, State)),
      {_,Count} = spiraltime:rep_minute(Up),
      Count.
  
  %% @spec slide_minute(integer(), integer(), state()) ->
  %%         {Count::integer(), Mean::ustat(),
  %%          {Median::ustat(), NinetyFive::ustat(),
  %%           NinetyNine::ustat(), Max::ustat()}}
  %% @type ustat() = undefined | number()
  %% @doc Get the Count of readings, the Mean of those readings, and the
  %%      Median, 95th percentile, 99th percentile, and Maximum readings
  %%      for the last minute from the slide structure at the given
  %%      element of the state tuple.
  %%      If Count is 0, then all other elements will be the atom
  %%      'undefined'.
  slide_minute(Moment, Elt, State) ->
      {Count, Mean} = slide:mean(element(Elt, State), Moment),
      {_, Nines} = slide:nines(element(Elt, State), Moment),
      {Count, Mean, Nines}.
  
  %% @spec vnode_stats(integer(), state()) -> proplist()
  %% @doc Get the vnode-sum stats proplist.
  vnode_stats(Moment, State) ->
      [{F, spiral_minute(Moment, Elt, State)}
       || {F, Elt} <- [{vnode_gets, #state.vnode_gets},
                       {vnode_puts, #state.vnode_puts}]].
  
  %% @spec node_stats(integer(), state()) -> proplist()
  %% @doc Get the node stats proplist.
  node_stats(Moment, State) ->
      {Gets, GetMean, {GetMedian, GetNF, GetNN, GetH}} =
          slide_minute(Moment, #state.get_fsm_time, State),
  