anchor.diff:           get_udp_config/0,
            get_data_dir/0,
            get_metric_filters/0,
  +         metric_passes_filters/2,
            udp_is_enabled/1]).
   
   
  
positive.code:                       }], parse_retentions(["1h:1y"]))
      ].
  
  -endif. % TEST
  
negative.code:     application:get_env(statser, data_dir, ?FALLBACK_METRICS_DATA_DIR).
  
  
  metric_passes_filters(Metric, Filters) ->
      WhiteList = Filters#metric_filters.whitelist,
      BlackList = Filters#metric_filters.blacklist,
      passes_blacklist(Metric, BlackList) andalso passes_whitelist(Metric, WhiteList).
  
  
  %%%===================================================================
  %%% Internal functions
  %%%===================================================================
  
  passes_whitelist(_Metric, []) -> true;
  passes_whitelist(Metric, WL) ->
      passes_whitelist_inner(Metric, WL).
  
  
  passes_whitelist_inner(_Metric, []) -> false;
  passes_whitelist_inner(Metric, [#metric_pattern{pattern=Pattern} | Ps]) ->
      case re:run(Metric, Pattern) of
          {match, _} -> true;
          _Otherwise -> passes_whitelist_inner(Metric, Ps)
      end.
  
  
  passes_blacklist(_Metric, []) -> true;
  passes_blacklist(Metric, [#metric_pattern{pattern=Pattern} | Ps]) ->
      case re:run(Metric, Pattern) of
          {match, _} -> false;
          _Otherwise -> passes_blacklist(Metric, Ps)
      end.
  
  
  first_or_fallback(_GetPattern, Fallback, _Path, []) -> Fallback;
  first_or_fallback(GetPattern, Fallback, Path, [C | Cs]) ->
  