anchor.diff:      end.
   
   notify_status_change(Status, #state{name=Name,observers=Observers}) ->
  -    catch throw(whereami),
  -    Stack = erlang:get_stacktrace(),
  -    ?debugVal(Stack),
       lager:info("Status change for ~s : ~s", [Name, Status]),
       [ Observer ! { node_heartbeat_event, Name, Status } || Observer <- Observers ].
   
  
positive.code:             gen_fsm:send_all_state_event(Pid, {Action, self()})
      end.
  
  
  init([Name, HeartbeatInterval, DeadIntervalCount]) ->
      {ok, initializing,
       #state{dead_interval=HeartbeatInterval * DeadIntervalCount,
              name=Name,
              heartbeat_rate=eavg_init(DeadIntervalCount, HeartbeatInterval)
             },
       0}.
  
  initializing(timeout, #state{name=Name}=State) ->
      case gproc:reg({n, l, Name}) of
          true ->
              {next_state, down, save_status(?SAVE_MODE, down, State)};
          false ->
              lager:error("Failed to register:~p for ~p", [Name,self()]),
              {stop, shutdown, State}
      end.
  
  
  %%%
  %%% State machine internals
  %%%
  up(current_state, _From, State) ->
      {reply, up, up, State}.
  
  crashed(current_state, _From, State) ->
      {reply, crashed, crashed, State}.
  
  restarting(current_state, _From, State) ->
      {reply, restarting, restarting, State}.
  
  %%
  %% These events are handled the same everywhere
  %%
  handle_event({start_watching, Who}, StateName, #state{observers=Observers}=State) ->
      State1 = case lists:member(Who, Observers) of
          false ->
  
negative.code: status_to_atom(<<"running">>) ->
      running;
  status_to_atom(<<"restarting">>) ->
      restarting;
  status_to_atom(<<"down">>) ->
      down.
  
  %
  % Question: Why isn't the gen_fsm:start_timer/cancel_timer used here?
  %
  reset_timer(#state{dead_interval=Interval, tref=undefined}=State) ->
      TRef = erlang:send_after(Interval, self(), no_heartbeats),
      State#state{tref=TRef};
  reset_timer(#state{dead_interval=Interval, tref=TRef}=State) ->
      erlang:cancel_timer(TRef),
      TRef1 = erlang:send_after(Interval, self(), down),
      State#state{tref=TRef1}.
  
  nlog(normal, Format, Args) ->
      lager:debug(Format, Args);
  