SnmpKit.SnmpSim.CorrelationEngine (snmpkit v0.6.4)

Implement realistic correlations between different metrics.

Network metrics don't exist in isolation - they influence each other in predictable ways:

  • Signal quality degrades with higher utilization
  • Error rates increase with poor signal quality
  • Temperature affects equipment performance
  • Power consumption correlates with activity levels

This module provides sophisticated correlation modeling for authentic network simulation.

Summary

Functions

Apply correlations to a device's metrics based on primary metric changes.

Model power consumption correlations with activity and temperature.

Calculate signal quality impact on throughput for DOCSIS devices.

Calculate temperature impact on equipment performance.

Get standard correlation configurations for common device types.

Types

correlation_config()

@type correlation_config() :: %{
  type: correlation_type(),
  strength: float(),
  delay_seconds: integer(),
  threshold: float(),
  noise_factor: float()
}

correlation_type()

@type correlation_type() ::
  :positive | :negative | :threshold | :exponential | :logarithmic

Functions

apply_correlations(primary_oid, primary_value, device_state, correlations, current_time)

@spec apply_correlations(atom(), number(), map(), list(), DateTime.t()) :: map()

Apply correlations to a device's metrics based on primary metric changes.

Examples

device_state = %{
  interface_utilization: 0.8,
  signal_quality: 85.0,
  temperature: 45.0
}

correlations = [
  {:interface_utilization, :error_rate, :positive, 0.7},
  {:signal_quality, :throughput, :positive, 0.9},
  {:temperature, :cpu_usage, :positive, 0.6}
]

updated_state = SnmpKit.SnmpSim.CorrelationEngine.apply_correlations(
  :interface_utilization, 0.8, device_state, correlations, DateTime.utc_now()
)

calculate_power_consumption_correlation(device_metrics, device_type)

@spec calculate_power_consumption_correlation(map(), atom()) :: float()

Model power consumption correlations with activity and temperature.

Power consumption correlates with:

  • CPU utilization
  • Network activity
  • Temperature (cooling requirements)

calculate_signal_throughput_correlation(snr_db, power_level_dbmv, max_throughput)

@spec calculate_signal_throughput_correlation(float(), float(), float()) :: float()

Calculate signal quality impact on throughput for DOCSIS devices.

Signal quality (SNR, power levels) directly affects achievable throughput in cable modem systems.

calculate_temperature_performance_correlation(temperature_celsius, equipment_type)

@spec calculate_temperature_performance_correlation(float(), atom()) :: %{
  cpu_impact: float(),
  signal_impact: float(),
  error_impact: float()
}

Calculate temperature impact on equipment performance.

Higher temperatures affect:

  • CPU performance (thermal throttling)
  • Signal quality (thermal noise)
  • Error rates (increased bit errors)

calculate_utilization_error_correlation(utilization_percent, interface_type)

@spec calculate_utilization_error_correlation(float(), atom()) :: float()

Calculate utilization impact on error rates.

Higher utilization typically leads to increased error rates due to:

  • Buffer overflows
  • Increased collision probability
  • Thermal effects

get_device_correlations(device_type)

@spec get_device_correlations(atom()) :: list()

Get standard correlation configurations for common device types.

Examples

correlations = SnmpKit.SnmpSim.CorrelationEngine.get_device_correlations(:cable_modem)