Search documentation of snmpkit

# SnmpKit.SnmpSim.MultiDeviceStartup (snmpkit v1.2.0)

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

## Types

device_spec()
progress_callback()
startup_opts()
startup_status()

## Functions

console_progress_callback()

Create a simple progress callback that logs to console.

get_startup_status()

Get startup progress and statistics.

pre_warm_devices(device_specs, opts \\ [])

Pre-warm a specified number of devices for immediate availability.

shutdown_device_population()

Gracefully shutdown all devices in the population.

start_device_mix(mix_type, opts \\ [])

Start devices using predefined device mix patterns.

start_device_population(device_specs, opts \\ [])

Start a large population of devices based on device specifications.

start_with_progress(device_specs, opts \\ [])

Start devices with console progress reporting.

# Types

# device_spec()

    @type device_spec() :: {device_type :: atom(), count :: non_neg_integer()}

# progress_callback()

    @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)

# startup_opts()

    @type startup_opts() :: [
      port_range: Range.t(),
      parallel_workers: pos_integer(),
      timeout_ms: pos_integer(),
      progress_callback: function() | nil
    ]

# startup_status()

    @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

# console_progress_callback()

    @spec console_progress_callback() :: progress_callback()

Create a simple progress callback that logs to console.

# get_startup_status()

    @spec get_startup_status() :: startup_status()

Get startup progress and statistics.

# pre_warm_devices(device_specs, opts \\ [])

    @spec pre_warm_devices([device_spec()], startup_opts()) ::
      {:ok, map()} | {:error, term()}

Pre-warm a specified number of devices for immediate availability.

# shutdown_device_population()

    @spec shutdown_device_population() :: :ok

Gracefully shutdown all devices in the population.

# start_device_mix(mix_type, opts \\ [])

    @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
    )

# start_device_population(device_specs, opts \\ [])

    @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
    )

# start_with_progress(device_specs, opts \\ [])

    @spec start_with_progress([device_spec()], startup_opts()) ::
      {:ok, map()} | {:error, term()}

Start devices with console progress reporting.