Skip to content

msmoiz/abacus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abacus

This is a simple implementation of a metric reporting interface. It provides the user with a simple method for emitting metrics from any scope and any thread while supporting batched uploads and periodic flushes in the background. It also flushes remaining metrics on program end.

fn main() {
    let _guard = set_reporter(SimpleReporter::new());

    for _ in 0..8 {
        metric!("requests", 1, "user" => "alice");
    }

    for _ in 0..3 {
        thread::spawn(|| {
            let thread_id = format!("{:?}", thread::current().id());
            metric!("requests", 3, "thread" => thread_id);
        });
    }

    thread::sleep(Duration::from_secs(5));

    metric!("requests", 1, "user" => "bob", "id" => "12345");
}

About

A metrics interface

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages