Module load_tester

Module load_tester 

Source
Expand description

Network Load Testing and Stress Testing Utilities

This module provides tools for stress-testing the network layer to understand performance characteristics, identify bottlenecks, and validate scalability.

§Features

  • Connection Load Testing: Test behavior under many simultaneous connections
  • DHT Query Storms: Stress-test DHT with high query volumes
  • Bandwidth Saturation: Test throughput limits
  • Provider Record Flooding: Test provider record handling at scale
  • Concurrent Operations: Test system under concurrent operations
  • Memory Pressure: Test behavior under memory constraints
  • Performance Metrics: Detailed performance tracking during tests

§Example

use ipfrs_network::load_tester::{LoadTester, LoadTestConfig, LoadTestType};
use std::time::Duration;

let config = LoadTestConfig {
    duration: Duration::from_secs(60),
    connection_target: 100,
    query_rate: 50, // queries per second
    ..Default::default()
};

let mut tester = LoadTester::new(config);
let results = tester.run_test(LoadTestType::ConnectionStress)?;

println!("Test passed: {}", results.passed);
println!("Peak connections: {}", results.peak_connections);
println!("Average latency: {:?}", results.average_latency);

Structs§

LoadTestConfig
Configuration for load testing
LoadTestMetrics
Metrics tracking for load tests
LoadTestResults
Results from a load test
LoadTester
Network load tester

Enums§

LoadTestError
Error types for load testing
LoadTestType
Type of load test to perform