nodeprofiling module #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The profiling module provides comprehensive system profiling and benchmarking capabilities for nodes, enabling performance analysis, capacity planning, and workload optimization. This module integrates industry-standard tools like iperf for network testing while providing custom benchmarks for disk I/O, memory performance, and CPU capabilities.
The module is designed to help operators understand the performance characteristics of their infrastructure, identify bottlenecks, and make informed decisions about workload placement. It generates detailed reports with historical comparisons, enabling trend analysis and performance regression detection across the fleet.
Functionality
Module API
Network Profiling
IperfClient::new(server: &str) -> Result<Self, ProfilingError>- Create iperf client for serverrun_iperf_test(config: IperfConfig) -> Result<IperfResult, ProfilingError>- Execute iperf testmeasure_bandwidth(server: &str, duration: Duration) -> Result<BandwidthResult, ProfilingError>- Measure bandwidthmeasure_latency(host: &str, count: u32) -> Result<LatencyResult, ProfilingError>- Measure network latencyrun_jitter_test(server: &str) -> Result<JitterResult, ProfilingError>- Measure network jittertest_udp_throughput(server: &str, bandwidth: u64) -> Result<ThroughputResult, ProfilingError>- Test UDP throughputIperfConfig::new() -> Self- Create iperf configurationIperfConfig::with_duration(duration: Duration) -> Self- Set test durationIperfConfig::with_parallel_streams(streams: u32) -> Self- Set parallel stream countIperfConfig::with_window_size(size: u32) -> Self- Set TCP window sizeDisk Profiling
DiskProfiler::new(device: &str) -> Result<Self, ProfilingError>- Create disk profilerrun_disk_benchmark(path: &Path) -> Result<DiskBenchmarkResult, ProfilingError>- Run full benchmarkmeasure_sequential_read(path: &Path, size: u64) -> Result<SequentialResult, ProfilingError>- Sequential read testmeasure_sequential_write(path: &Path, size: u64) -> Result<SequentialResult, ProfilingError>- Sequential write testmeasure_random_read(path: &Path, size: u64) -> Result<RandomResult, ProfilingError>- Random read testmeasure_random_write(path: &Path, size: u64) -> Result<RandomResult, ProfilingError>- Random write testmeasure_iops(path: &Path) -> Result<IOPSResult, ProfilingError>- Measure IOPS performancetest_disk_latency(path: &Path) -> Result<LatencyResult, ProfilingError>- Test disk latencyMemory Profiling
MemoryProfiler::new() -> Self- Create memory profilermeasure_memory_bandwidth() -> Result<MemoryBandwidthResult, ProfilingError>- Measure bandwidthtest_memory_latency(size: u64) -> Result<MemoryLatencyResult, ProfilingError>- Test memory latencyrun_memory_stress_test(duration: Duration) -> Result<StressTestResult, ProfilingError>- Stress test memorymeasure_cache_performance() -> Result<CacheResult, ProfilingError>- Test cache performancetest_numa_bandwidth() -> Result<NumaResult, ProfilingError>- Test NUMA bandwidthprofile_memory_usage(pid: u32) -> Result<MemoryUsageProfile, ProfilingError>- Profile memory usageCPU Profiling
CPUProfiler::new() -> Self- Create CPU profilerrun_cpu_benchmark(threads: u32, duration: Duration) -> Result<CPUBenchmarkResult, ProfilingError>- Run benchmarkmeasure_single_thread_performance() -> Result<SingleThreadResult, ProfilingError>- Single thread testmeasure_multi_thread_scaling(threads: u32) -> Result<ScalingResult, ProfilingError>- Multi-thread scalingtest_instruction_throughput() -> Result<InstructionResult, ProfilingError>- Test instruction throughputmeasure_cache_misses() -> Result<CacheMissResult, ProfilingError>- Measure cache missesprofile_cpu_usage(pid: u32, duration: Duration) -> Result<CPUUsageProfile, ProfilingError>- Profile CPU usageBenchmark Reports
BenchmarkReport::new() -> Self- Create new benchmark reportadd_network_result(&mut self, result: IperfResult) -> &mut Self- Add network resultsadd_disk_result(&mut self, result: DiskBenchmarkResult) -> &mut Self- Add disk resultsadd_memory_result(&mut self, result: MemoryBandwidthResult) -> &mut Self- Add memory resultsadd_cpu_result(&mut self, result: CPUBenchmarkResult) -> &mut Self- Add CPU resultsgenerate_json(&self) -> Result<String, ProfilingError>- Generate JSON reportgenerate_html(&self) -> Result<String, ProfilingError>- Generate HTML reportcompare_baselines(&self, baseline: &BenchmarkReport) -> ComparisonResult- Compare with baselineexport_to_csv(&self, path: &Path) -> Result<(), ProfilingError>- Export to CSV format