<commit_before>f(ChildPids).
ChildPids = fun (Sup) ->
              [ element(2, R) || R <- supervisor:which_children(Sup) ]
            end.

f(UpgradeNode).
UpgradeNode = fun () ->
  io:format(whereis(user), "at=upgrade_start cur_vsn=33~n", []),
  l(nsync_callback),

  Proxies = ChildPids(tcp_proxy_sup),
  lists:map(fun sys:suspend/1, Proxies),
  l(tcp_proxy),
  [ sys:change_code(P, tcp_proxy, v33, undefined) || P <- Proxies ],
  lists:map(fun sys:resume/1, Proxies),

  Drains = [Pid ||
               {Pid, tcpsyslog} <- gproc:lookup_local_properties(drain_type)],
  lists:map(fun sys:suspend/1, Drains),
  l(logplex_tcpsyslog_drain),
  [ sys:change_code(P, logplex_tcpsyslog_drain,
                    v33, undefined) || P <- Drains ],
  lists:map(fun sys:resume/1, Drains),


  io:format(whereis(user), "at=upgrade_end cur_vsn=34~n", []),
  length(Drains ++ Proxies)
end.<commit_msg>Fix bogus stats entries.<commit_after>f(ChildPids).
ChildPids = fun (Sup) ->
              [ element(2, R) || R <- supervisor:which_children(Sup) ]
            end.

f(UpgradeNode).
UpgradeNode = fun () ->
  io:format(whereis(user), "at=upgrade_start cur_vsn=33~n", []),
  l(nsync_callback),
  l(logplex_worker),
  %% Clean up bogus stats entries.
  ets:select_delete(logplex_stats, 
                    ets:fun2ms(fun ({{drain_stat, K, _, _}, 0}) when is_tuple(K) -> true end)),

  Proxies = ChildPids(tcp_proxy_sup),
  lists:map(fun sys:suspend/1, Proxies),
  l(tcp_proxy),
  [ sys:change_code(P, tcp_proxy, v33, undefined) || P <- Proxies ],
  lists:map(fun sys:resume/1, Proxies),

  Drains = [Pid ||
               {Pid, tcpsyslog} <- gproc:lookup_local_properties(drain_type)],
  lists:map(fun sys:suspend/1, Drains),
  l(logplex_tcpsyslog_drain),
  [ sys:change_code(P, logplex_tcpsyslog_drain,
                    v33, undefined) || P <- Drains ],
  lists:map(fun sys:resume/1, Drains),


  io:format(whereis(user), "at=upgrade_end cur_vsn=34~n", []),
  length(Drains ++ Proxies)
end.
{'fraction_non_alphanumeric': 0.163727959697733, 'fraction_numerical': 0.014105793450881612, 'mean_word_length': 3.672941176470588, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7200882', 'n_tokens_mistral': 802, 'n_tokens_neox': 771, 'n_words': 127}