anchor.diff:  %
   % This is split into two phases: an 'upper half' to get the minimimal work done required to wire things up
   % and a 'lower half' that takes care of things that can wait
  -% 
  -init([Name, HeartbeatInterval, DeadIntervalCount]) ->
  +%
  +init([Name]) ->
  +    HeartbeatInterval = 1,
  +    DecayWindow = 5,
  +    UpThresh   = pushy_util:get_env(push, up_threshold, ?DEFAULT_UP_THRESHOLD, any), %% TODO constrain to float
  +    DownThresh = pushy_util:get_env(push, down_threshold, ?DEFAULT_DOWN_THRESHOLD, any), %% TODO constrain to float
   
       State = #state{name = Name,
  -                   dead_interval = HeartbeatInterval * DeadIntervalCount,
  -                   heartbeats = 0,
  +                   decay_window = DecayWindow,
  +                   heartbeat_interval = HeartbeatInterval,
                      current_status = down, % Fetch from db later
  -                   heartbeat_rate = pushy_ema:init(DeadIntervalCount, HeartbeatInterval)},
  +                   heartbeat_rate = pushy_ema:init(HeartbeatInterval, DecayWindow),
  +                   up_threshold = UpThresh,
  +                   down_threshold = DownThresh
  +                  },
       try
           %% The most important thing to have happen is this registration; we need to get this
           %% assigned before anyone else tries to start things up gproc:reg can only return
  
positive.code: up(current_state, _From, #state{heartbeat_rate=HRate}=State) ->
      {reply, {up, push_ema:value(HRate)}, up, State}.
  
  crashed(current_state, _From, #state{heartbeat_rate=HRate}=State) ->
      {reply, {crashed, push_ema:value(HRate)}, crashed, State}.
  
  restarting(current_state, _From, #state{heartbeat_rate=HRate}=State) ->
      {reply, {restarting, push_ema:value(HRate)}, restarting, State}.
  
  %%
  %% These events are handled the same for every state
  
negative.code:     StateData2 = StateData#state{
                     current_status = down % TODO Fetch this from the db someday
                     },
      {next_state, down, create_status_record(down, StateData2)}.
  
  %%%
  %%% State machine internals
  