SnmpKit.SnmpSim.MultiDeviceStartup (snmpkit v0.6.3)
Multi-Device Startup functionality for large-scale device population management.
Features:
- Bulk device population startup
- Progress monitoring and reporting
- Parallel device creation for speed
- Failure handling and recovery
- Integration with LazyDevicePool and DeviceDistribution
Summary
Functions
Create a simple progress callback that logs to console.
Get startup progress and statistics.
Pre-warm a specified number of devices for immediate availability.
Gracefully shutdown all devices in the population.
Start devices using predefined device mix patterns.
Start a large population of devices based on device specifications.
Start devices with console progress reporting.
Types
@type device_spec() :: {device_type :: atom(), count :: non_neg_integer()}
@type progress_callback() :: (%{ completed: non_neg_integer(), total: non_neg_integer(), progress: float(), elapsed_ms: non_neg_integer(), eta_ms: nil | non_neg_integer() } -> :ok)
@type startup_opts() :: [ port_range: Range.t(), parallel_workers: pos_integer(), timeout_ms: pos_integer(), progress_callback: function() | nil ]
@type startup_status() :: %{ active_devices: non_neg_integer(), peak_devices: non_neg_integer(), devices_created: non_neg_integer(), devices_cleaned_up: non_neg_integer(), total_ports_configured: non_neg_integer() }
Functions
@spec console_progress_callback() :: progress_callback()
Create a simple progress callback that logs to console.
@spec get_startup_status() :: startup_status()
Get startup progress and statistics.
@spec pre_warm_devices([device_spec()], startup_opts()) :: {:ok, map()} | {:error, term()}
Pre-warm a specified number of devices for immediate availability.
@spec shutdown_device_population() :: :ok
Gracefully shutdown all devices in the population.
@spec start_device_mix(atom(), startup_opts()) :: {:ok, map()} | {:error, term()}
Start devices using predefined device mix patterns.
Examples
{:ok, result} = SnmpKit.SnmpSim.MultiDeviceStartup.start_device_mix(
:cable_network,
port_range: 30_000..39_999
)
@spec start_device_population([device_spec()], startup_opts()) :: {:ok, map()} | {:error, term()}
Start a large population of devices based on device specifications.
Examples
device_specs = [
{:cable_modem, 1000},
{:switch, 50},
{:router, 10},
{:cmts, 5}
]
{:ok, result} = SnmpKit.SnmpSim.MultiDeviceStartup.start_device_population(
device_specs,
port_range: 30_000..31_099,
parallel_workers: 100
)
@spec start_with_progress([device_spec()], startup_opts()) :: {:ok, map()} | {:error, term()}
Start devices with console progress reporting.