anchor.diff:  %% @spec terminate(Reason, State) -> void()
   %% @end
   %%--------------------------------------------------------------------
  -terminate(_Reason, _State) ->
  +terminate(_Reason, #state{diag_pid = DiagPid} = _State) ->
  +    case DiagPid of
  +        undefined ->
  +            ok;
  +        _ ->
  +            misc:terminate_and_wait(kill, DiagPid)
  +    end,
       ok.
   
   %%--------------------------------------------------------------------
  
positive.code: %%                                   {stop, Reason, State}
  %% @end
  %%--------------------------------------------------------------------
  handle_info(_Info, State) ->
      {noreply, State}.
  
  
negative.code: 
  -define(MIN_LOG_INTERVAL, 5000).
  
  -record(state, {last_tstamp,
                  diag_pid}).
  
  %%%===================================================================
  %%% API
  