NAME
Developer::Dashboard::CollectorRunner - collector execution and loop management
SYNOPSIS
my $runner = Developer::Dashboard::CollectorRunner->new(...);
my $result = $runner->run_once($job);
DESCRIPTION
This module runs collector jobs on demand and as managed background loops. It handles scheduling, timeout enforcement, process naming, persisted loop state, shell-command collectors, and Perl-code collectors.
METHODS
new, run_once, start_loop, stop_loop, running_loops, loop_state
Construct and manage collector execution.
PURPOSE
This module manages live collector execution. It turns stored collector jobs into processes, captures their output, updates collector state files, tracks pid ownership, and exposes the start/stop/restart/run/status lifecycle used by the CLI and web-facing status features.
WHY IT EXISTS
It exists because collector process control is more than a single system() call. The dashboard needs a single owner for pid validation, output capture, environment preparation, enabled/disabled state, and restart behavior so the prompt and browser status strip can trust the result.
WHEN TO USE
Use this file when changing collector process spawning, pid validation, restart semantics, background job cleanup, or the contract between collector execution and the persisted collector state.
HOW TO USE
Construct it with the path registry and collector store, then call the lifecycle methods for one collector name. Keep process-management behavior here; the CLI wrappers should only parse arguments and print the returned state.
WHAT USES IT
It is used by the dashboard collector ... command family, by runtime restart/stop flows that manage collectors together with the web process, and by collector/runtimemanager regression tests.
EXAMPLES
Example 1:
perl -Ilib -MDeveloper::Dashboard::CollectorRunner -e 1
Do a direct compile-and-load check against the module from a source checkout.
Example 2:
prove -lv t/02-indicator-collector.t
Run the focused regression tests that most directly exercise this module's behavior.
Example 3:
HARNESS_PERL_SWITCHES=-MDevel::Cover prove -lr t
Recheck the module under the repository coverage gate rather than relying on a load-only probe.
Example 4:
prove -lr t
Put any module-level change back through the entire repository suite before release.