17 releases

Uses old Rust 2015

0.0.17 Aug 24, 2015
0.0.16 May 12, 2015
0.0.14 Apr 25, 2015

#25 in #cosmos

Download history 5/week @ 2022-01-21 2/week @ 2022-01-28 2/week @ 2022-02-04 2/week @ 2022-02-11 20/week @ 2022-02-18 2/week @ 2022-02-25 2/week @ 2022-03-04 53/week @ 2022-03-11 70/week @ 2022-03-18 2/week @ 2022-03-25 3/week @ 2022-04-01 3/week @ 2022-04-08 3/week @ 2022-04-15 19/week @ 2022-04-22 71/week @ 2022-04-29 105/week @ 2022-05-06

198 downloads per month
Used in curiosity

Apache-2.0

5KB
103 lines

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);
}

lib.rs:

Cosmos

Dependencies

~2.2–3.5MB
~74K SLoC