cosmos

Crates.iocosmos
lib.rscosmos
version0.0.17
sourcesrc
created_at2015-04-01 10:58:12.902333
updated_at2015-12-11 23:58:10.571132
descriptionCosmos
homepagehttps://github.com/cosmos-io/rust-cosmos
repositoryhttps://github.com/cosmos-io/rust-cosmos.git
max_upload_size
id1754
size4,851
Graham Lee (ghmlee)

documentation

https://cosmos-io.github.io/rust-cosmos/doc/cosmos

README

Cosmos

Build Status

Documentation is available here.

Quick start

[dependencies]
cosmos = "0.0.17"
extern crate cosmos;

use cosmos::Cosmos;
use cosmos::Container;

fn main() {
    let host = "localhost:8888";
    let planet = "Mars";
    let cosmos = Cosmos::new(host, planet);
    let mut containers: Vec<Container> = Vec::new();
    let container = Container {
        Container: "curiosity".to_string(),
        Cpu: 8.08 as f32,
        Memory: 4096 as u64,
    };
    containers.push(container);

    let response = match cosmos.post_metrics(&containers) {
        Ok(response) => response,
        Err(e) => {
            panic!("{}", e);
        }
    };

    println!("{} {}", response.status_code, response_body);
}
Commit count: 0

cargo fmt