anchor.diff:          {ok, Prev} ->
               Val > Prev
       end.
  +
  +
  +%% Format the error message into a binary
  +fmt_to_bin(Str, Args) ->
  +    list_to_binary(lists:flatten(io_lib:format(Str, Args))).
   
   
   %% Cant currently test the alert timeouts as would need to mock
  
positive.code:     end.
  
  
  %% Format the error message into a binary
  fmt_to_bin(Str, Args) ->
      list_to_binary(lists:flatten(io_lib:format(Str, Args))).
  
  
  %% @doc List of oom errors for each bucket
  -spec oom_errors() -> dict().
  oom_errors() ->
      dict:from_list(
        [{Bucket, bucket_oom_errors(Bucket)}
         || Bucket <- ns_memcached:active_buckets()]
       ).
  
  %% @doc Total count of oom errors on a bucket
  -spec bucket_oom_errors(string()) -> integer().
  bucket_oom_errors(Bucket) ->
      case stats_archiver:latest(Bucket, minute, ep_oom_errors) of
          {ep_oom_errors, X} -> X;
          _ -> 0
      end.
  
  
negative.code: %% Amount of time between sending users the same alert (s)
  -define(ALERT_TIMEOUT, 60 * 2).
  
  -export([start_link/0, stop/0, local_alert/2, global_alert/2, fetch_alerts/0]).
  
  
  %% Error constants
  errors(ip) ->
      "Cannot listen on hostname: ~p";
  errors(ep_oom_errors) ->
      "Bucket \"~s\" on node ~s is out of memory";
  errors(ep_item_commit_failed) ->
      "Bucket \"~s\" on node ~s failed to write an item".
  
  %% ------------------------------------------------------------------
  %% API Function Definitions
  