Search documentation of snmpkit

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

Generate realistic values based on MIB-derived behavior patterns. Supports counters, gauges, enums, and correlated metrics with time-based variations.

# Summary

## Functions

apply_configurable_jitter(value, metric_type, device_type, jitter_config \\ %{})

Apply configurable jitter to gauge values based on device and metric type. Different metrics have different jitter characteristics.

apply_device_specific_counter_behavior(value, type, device_type, config \\ %{})

Simulate realistic counter wrap behavior with device-specific patterns. Different device types may handle wrap differently.

counter_approaching_wrap?(value, type, threshold_percent \\ 0.95)

Check if a counter value is approaching its maximum and likely to wrap soon. Used to predict and prepare for counter wrap events.

handle_counter_discontinuity(old_value, new_value, discontinuity_counter)

Generate counter discontinuity events that occur during counter wraps. Some devices increment discontinuity counters when main counters wrap.

simulate_value(profile_data, behavior_config, device_state)

Simulate a value based on profile data, behavior configuration, and device state.

time_until_counter_wrap(current_value, increment_rate, type)

Calculate the time until counter wrap based on current increment rate. Returns estimated seconds until wrap occurs.

# Functions

# apply_configurable_jitter(value, metric_type, device_type, jitter_config \\ %{})

Apply configurable jitter to gauge values based on device and metric type. Different metrics have different jitter characteristics.

# apply_device_specific_counter_behavior(value, type, device_type, config \\ %{})

Simulate realistic counter wrap behavior with device-specific patterns. Different device types may handle wrap differently.

# counter_approaching_wrap?(value, type, threshold_percent \\ 0.95)

Check if a counter value is approaching its maximum and likely to wrap soon. Used to predict and prepare for counter wrap events.

# handle_counter_discontinuity(old_value, new_value, discontinuity_counter)

Generate counter discontinuity events that occur during counter wraps. Some devices increment discontinuity counters when main counters wrap.

# simulate_value(profile_data, behavior_config, device_state)

Simulate a value based on profile data, behavior configuration, and device state.

## Examples

    # Traffic counter simulation
    value = SnmpKit.SnmpSim.ValueSimulator.simulate_value(
      %{type: "Counter32", value: 1000000},
      {:traffic_counter, %{rate_range: {1000, 125_000_000}}},
      %{device_id: "cm_001", uptime: 3600, interface_utilization: 0.3}
    )

# time_until_counter_wrap(current_value, increment_rate, type)

Calculate the time until counter wrap based on current increment rate. Returns estimated seconds until wrap occurs.