Struct remotery::Remotery
[−]
[src]
pub struct Remotery { // some fields omitted }
Holds the main instance for Remotery
Methods
impl Remotery
[src]
fn create_global_instance() -> Result<Remotery, RemoteryError>
Creates the global instance (with in the C lib that this code wraps) this code needs to be
called before any of the other code is being called and the instance will be dropped when
it goes out of scope so it's suggested to call this early in the main entry point of your
program (such as main
)
Examples
let _remotery = Remotery::create_global_instance().unwrap_or_else(|e| { panic!(e); });
fn begin_cpu_sample(name: &str, flags: SampleFlags)
Begin a cpu sample. Notice that this call needs to be paired with end_cpu_sample
.
It's also possible to use RemoteryScope
that will call end_cpu_scope when the scop ends.
Examples
Remotery::begin_cpu_sample("my_function", SampleFlags::Default); // some code to profile here Remotery::end_cpu_sample();
fn end_cpu_sample()
Ends a cpu sample. Notice that this needs to be paired with begin_cpu_sample
as seen above.
fn set_current_thread_name(name: &str)
Setts the name of the current thread that makes it easier to identify it in the Remotery UI
Examples
Remotery::set_current_thread_name("my_thread_name");
fn log_text(text: &str)
Can be used to log text to the remotery ui