1 unstable release

0.1.0 Feb 18, 2023

#120 in #microservices

21 downloads per month

MIT/Apache

26KB
612 lines

Metrs

Metrics microservice

Stars Build With Chat on Discord

Tests Clippy

codecov

Overview

Metrs is a microservice to help you gather metrics information about an host It will send in real time the Cpu, Memory, Disk and Network usage information. This service don't store anything in database, it he designed to only emit information.

The daemon

Usage: metrsd --hosts <HOSTS>

Options:
  -H, --hosts <HOSTS>  Hosts to listen on
  -h, --help           Print help

Example:

metrsd --hosts tcp://127.0.0.1:8080

The client

A rust client is available for you to use using ntex

You can install it by running:

cargo add metrsd_client

And then call the subscribe event


use metrsd_client::MetrsdClient;

#[ntex::main]
async fn main() -> std::io::Result<()> {
  let client = MetrsdClient::connect("http://localhost:8080");

  let stream = client.subscribe().await.unwrap();

  while let Some(ev) = stream.next().await {
    println!("{ev:#?}");
  }
  Ok(())
}

The cli

There is not CLI for the moment but it's planned

Dependencies

~23–57MB
~1M SLoC