evaluator_pool_registry (faber_neuroevolution v1.2.4)

View Source

Evaluator pool registry for distributed evaluation.

Tracks the capacity and availability of evaluator nodes across the mesh. Provides load-balanced selection of evaluator nodes based on: - Current load (active evaluations) - Maximum capacity (CPU cores / configured limit) - Latency estimates - Node health

Summary

Functions

get_all_evaluators()

-spec get_all_evaluators() ->
                            [#evaluator_node{node_id :: binary(),
                                             endpoint :: binary(),
                                             capacity :: pos_integer(),
                                             active :: non_neg_integer(),
                                             evaluator_module :: module(),
                                             latency_ms :: non_neg_integer(),
                                             last_heartbeat :: integer(),
                                             error_count :: non_neg_integer()}].

get_available_evaluator()

-spec get_available_evaluator() ->
                                 {ok,
                                  #evaluator_node{node_id :: binary(),
                                                  endpoint :: binary(),
                                                  capacity :: pos_integer(),
                                                  active :: non_neg_integer(),
                                                  evaluator_module :: module(),
                                                  latency_ms :: non_neg_integer(),
                                                  last_heartbeat :: integer(),
                                                  error_count :: non_neg_integer()}} |
                                 {error, no_evaluators}.

get_available_evaluator(Options)

-spec get_available_evaluator(Options :: map()) ->
                                 {ok,
                                  #evaluator_node{node_id :: binary(),
                                                  endpoint :: binary(),
                                                  capacity :: pos_integer(),
                                                  active :: non_neg_integer(),
                                                  evaluator_module :: module(),
                                                  latency_ms :: non_neg_integer(),
                                                  last_heartbeat :: integer(),
                                                  error_count :: non_neg_integer()}} |
                                 {error, no_evaluators}.

get_stats()

-spec get_stats() -> map().

handle_call(Request, From, State)

handle_cast(Msg, State)

handle_info(Info, State)

init(Config)

register_evaluator(NodeId, Info)

-spec register_evaluator(NodeId :: binary(), Info :: map()) -> ok.

report_evaluation_completed(NodeId, LatencyMs)

-spec report_evaluation_completed(NodeId :: binary(), LatencyMs :: non_neg_integer()) -> ok.

report_evaluation_started(NodeId)

-spec report_evaluation_started(NodeId :: binary()) -> ok.

start_link(Config)

-spec start_link(Config :: map()) -> {ok, pid()} | {error, term()}.

terminate(Reason, State)

unregister_evaluator(NodeId)

-spec unregister_evaluator(NodeId :: binary()) -> ok.