Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 1.21 KB

README.md

File metadata and controls

39 lines (31 loc) · 1.21 KB

miniremotery

Minimal Rust wrapper around the Remotery real-time CPU profiler. GPU profiling is not supported.

Inspired by (seemingly outdated and abandoned) remotery, which this is a slightly updated version of.

How to use

  1. Call Remotery::initialize at application startup.

Example

use miniremotery::Remotery;
use strum::EnumMessage;

let profiler = Remotery::initialize().unwrap_or_else(
    |error| panic!(
        "Remotery initialization error: {}"
        ,error.get_detailed_message().unwrap()
    )
);
// Remotery is finalized when `profiler` goes out of scope.
  1. Add calls to Remotery::scope to code scopes you want to profile.

Example

use miniremotery::{ Remotery, rmtSampleFlags };

fn does_something_complicated() {
    let _scope = Remotery::scope("does_something_complicated", rmtSampleFlags::RMTSF_None);

    // Some expensive calculations.

    // Remotery gathers timing data when `_scope` goes out of scope.
}
  1. Open vis/index.html when the profiled application is running to view real-time profile data.

Refer to Remotery repo for more info.