<commit_before>% Copyright (c) 2009, NorthScale, Inc.
% All rights reserved.

-module(mc_downstream).

-include_lib("eunit/include/eunit.hrl").

-include("mc_constants.hrl").

-include("mc_entry.hrl").

-compile(export_all).

-define(TIMEOUT_AWAIT_OK,         100000). % 100 seconds.
-define(TIMEOUT_WORKER_GO,          1000). % 1 seconds.
-define(TIMEOUT_WORKER_INACTIVE, 1000000). % 1000 seconds.

-record(dmgr, {curr,   % A dict of all the currently active, alive mboxes.
               timeout % Timeout for worker inactivity.
              }).

% We have one MBox (or worker) per Addr.
%
-record(mbox, {addr, pid, started}).

%% API for downstream manager service.
%%
%% This module is unaware of pools or buckets.  It only knows of and<commit_msg>Fix declaration of mc_downstream<commit_after>% Copyright (c) 2009, NorthScale, Inc.
% All rights reserved.

-module(mc_downstream).

-behavior(gen_server).

-include_lib("eunit/include/eunit.hrl").

-include("mc_constants.hrl").

-include("mc_entry.hrl").

%% API
-export([start_link/0, start_link/1,
         monitor/1, demonitor/1,
         send/6, send/8, kind_to_module/1,
         await_ok/1, accum/2]).

%% Does not belong here.
-export([group_by/2]).

%% gen_server
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
         terminate/2, code_change/3]).

-define(TIMEOUT_AWAIT_OK,         100000). % 100 seconds.
-define(TIMEOUT_WORKER_GO,          1000). % 1 seconds.
-define(TIMEOUT_WORKER_INACTIVE, 1000000). % 1000 seconds.

-record(dmgr, {curr,   % A dict of all the currently active, alive mboxes.
               timeout % Timeout for worker inactivity.
              }).

% We have one MBox (or worker) per Addr.
%
-record(mbox, {addr, pid, started}).

%% API for downstream manager service.
%%
%% This module is unaware of pools or buckets.  It only knows of and
{'fraction_non_alphanumeric': 0.13557483731019523, 'fraction_numerical': 0.04013015184381779, 'mean_word_length': 3.164785553047404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7566732', 'n_tokens_mistral': 673, 'n_tokens_neox': 622, 'n_words': 168}