anchor.diff:  %% @spec terminate(Reason, State) -> void()
   %% @end
   %%--------------------------------------------------------------------
  +terminate(_Reason, #state{timer=undefined}) ->
  +    lager:info("terminating finder server at ~w", [self()]),
  +    ok;
  +
   terminate(_Reason, #state{timer=Timer}) ->
       lager:info("terminating finder server at ~w", [self()]),
       erlang:cancel_timer(Timer, [{async, true}]),
  
positive.code: %%% Internal functions
  %%%===================================================================
  
  update_metrics_files(#state{data_dir=Dir, count=OldCount}=State) ->
      lager:debug("updating finder metrics files"),
      Start = erlang:monotonic_time(millisecond),
  
      State0 = case find_metrics_files(Dir) of
                   [#metric_dir{contents=Ms}] ->
                       Count = count_metrics(Ms),
  
                       if OldCount /= Count ->
                              Duration = erlang:monotonic_time(millisecond) - Start,
                              lager:info("found ~p metrics in data directory '~s' [took ~p ms]", [Count, Dir, Duration]);
                          true -> ok
                       end,
  
                       State#state{metrics=Ms, count=Count};
                   _Otherwise ->
                       if OldCount /= 0 ->
                              lager:info("no metrics found in data directory '~s'", [Dir]);
                          true -> ok
                       end,
                       State#state{metrics=[], count=0}
               end,
  
      Timer = erlang:send_after(?FINDER_UPDATE_INTERVAL, self(), update_metrics),
      State0#state{timer=Timer}.
  
  
  count_metrics(Metrics) ->
  
negative.code: 
  -define(FINDER_UPDATE_INTERVAL, 60000).
  
  -record(state, {metrics=[], status=none, data_dir, timer, count}).
  
  -record(metric_file, {
            name :: nonempty_string(),
  