anchor.diff:  %% @doc global checks for any server specific problems locally then
   %% broadcast alerts to clients connected to any particular node
   global_checks() ->
  -    [oom, ip].
  +    [oom, ip, write_fail].
   
   %% @doc fires off various checks
   check_alerts(Opaque, Hist) ->
  
positive.code: %% Amount of time between sending users the same alert (s)
  -define(ALERT_TIMEOUT, 60 * 2).
  
  -define(IP_ERR, "Cannot listen on hostname: ~p").
  -define(OOM_ERR, "Bucket \"~s\" on node ~s is out of memory").
  
  -export([start_link/0, stop/0, local_alert/2, global_alert/2, fetch_alerts/0]).
  
  %% ------------------------------------------------------------------
  %% API Function Definitions
  
negative.code:     end.
  
  
  %% @doc list of buckets thats measured stats have increased
  -spec stat_increased(dict(), dict()) -> list().
  stat_increased(New, Old) ->
      [Bucket || {Bucket, Val} <- dict:to_list(New), increased(Bucket, Val, Old)].
  
  
  %% @doc fetch a list of a stat for all buckets
  fetch_buckets_stat(Stat) ->
      dict:from_list(
        [{Bucket, fetch_bucket_stat(Bucket, Stat)}
         || Bucket <- ns_memcached:active_buckets()]
       ).
  
  
  %% @doc fetch latest value of stat for particular bucket
  fetch_bucket_stat(Bucket, Stat) ->
      case stats_archiver:latest(Bucket, minute, Stat) of
          {Stat, X} -> X;
          _ -> 0
      end.
  
  