Struct self_meter_http::Meter [] [src]

pub struct Meter(_);

A wrapper around original self_meter::Meter that locks internal mutex on most operations and maybe used in multiple threads safely.

Methods

impl Meter
[src]

Create a new meter with specified scan iterval of one second

Adds a scanner coroutine to tokio main loop

This must be called once per process (not per thread or tokio loop)

Serialize response into JSON

Get serializable report

Get serializable report for process data

This is a part of report() / Report, and is needed for fine-grained serialization control.

Get serializable report for thread data

This is a part of report() / Report, and is needed for fine-grained serialization control.

Same as serialize but also adds required HTTP headers

Start tracking specified thread

Note: you must add main thread here manually. Usually you should use track_current_thread() instead.

Stop tracking specified thread (for example if it's dead)

Add current thread using track_thread, returns thread id

Track current thread by using name from std::thread::current().name()

This may not work if thread has no name, use track_current_thread if thread has no own name or if you're unsure.

Panics

If no thread is set.

Remove current thread using untrack_thread

Trait Implementations

impl Clone for Meter
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Meter
[src]

Formats the value using the given formatter.