1 unstable release

0.1.0 Feb 4, 2026

#2174 in Concurrency


Used in 2 crates (via numaperf)

MIT license

120KB
2.5K SLoC

numaperf-perf

Crates.io Documentation

NUMA locality observability and metrics collection.

Overview

numaperf-perf provides tools for monitoring NUMA locality effectiveness. Track local vs remote work execution, generate health reports, and identify cross-node traffic in your application.

Usage

[dependencies]
numaperf-perf = "0.1"

Most users should use the numaperf facade crate instead.

Example

use numaperf_perf::{StatsCollector, LocalityReport, LocalityHealth};
use numaperf_topo::Topology;
use std::sync::Arc;

fn main() -> Result<(), numaperf_core::NumaError> {
    let topo = Arc::new(Topology::discover()?);
    let collector = StatsCollector::new(&topo);

    // Record work execution
    collector.record_local_execution();
    collector.record_steal(numaperf_core::NodeId::new(1));

    // Take a snapshot
    let stats = collector.snapshot();
    println!("Locality: {:.1}%", stats.locality_ratio() * 100.0);

    // Generate health report
    let report = LocalityReport::generate(&stats);
    match report.health() {
        LocalityHealth::Excellent => println!("Great!"),
        LocalityHealth::Poor => {
            for rec in report.recommendations() {
                println!("Recommendation: {}", rec);
            }
        }
        _ => {}
    }

    Ok(())
}

Features

  • StatsCollector - Lock-free metrics collection
  • LocalityStats - Point-in-time snapshots
  • LocalityReport - Health assessment with recommendations
  • Per-node breakdown - Detailed per-node statistics

Health Levels

Level Locality Meaning
Excellent > 95% Optimal
Good 85-95% Acceptable
Fair 70-85% Consider tuning
Poor < 70% Needs attention

Part of numaperf

This crate is part of the numaperf workspace.

License

Licensed under the MIT License.

Dependencies

~115–510KB
~12K SLoC