merge stats changes
This commit is contained in:
commit
f62c8f0b51
|
@ -2602,7 +2602,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "peach-stats"
|
name = "peach-stats"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log 0.4.14",
|
"log 0.4.14",
|
||||||
"miniserde",
|
"miniserde",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "peach-stats"
|
name = "peach-stats"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
authors = ["Andrew Reid <glyph@mycelial.technology>"]
|
authors = ["Andrew Reid <glyph@mycelial.technology>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Query system statistics. Provides a wrapper around the probes and systemstat crates."
|
description = "Query system statistics. Provides a wrapper around the probes and systemstat crates."
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# peach-stats
|
# peach-stats
|
||||||
|
|
||||||
![Generic badge](https://img.shields.io/badge/version-0.1.0-<COLOR>.svg)
|
![Generic badge](https://img.shields.io/badge/version-0.2.0-<COLOR>.svg)
|
||||||
|
|
||||||
System statistics library for PeachCloud. Provides a wrapper around the [probes](https://crates.io/crates/probes) and [systemstat](https://crates.io/crates/systemstat) crates.
|
System statistics library for PeachCloud. Provides a wrapper around the [probes](https://crates.io/crates/probes) and [systemstat](https://crates.io/crates/systemstat) crates.
|
||||||
|
|
||||||
|
@ -16,15 +16,15 @@ Currently offers the following statistics and associated data structures:
|
||||||
## Example Usage
|
## Example Usage
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use peach_stats::StatsError;
|
use peach_stats::{stats, StatsError};
|
||||||
|
|
||||||
fn main() -> Result<(), StatsError> {
|
fn main() -> Result<(), StatsError> {
|
||||||
let cpu = peach_stats::cpu_stats()?;
|
let cpu = stats::cpu_stats()?;
|
||||||
let cpu_percentages = peach_stats::cpu_stats_percent()?;
|
let cpu_percentages = stats::cpu_stats_percent()?;
|
||||||
let disks = peach_stats::disk_usage()?;
|
let disks = stats::disk_usage()?;
|
||||||
let load = peach_stats::load_average()?;
|
let load = stats::load_average()?;
|
||||||
let mem = peach_stats::mem_stats()?;
|
let mem = stats::mem_stats()?;
|
||||||
let uptime = peach_stats::uptime()?;
|
let uptime = stats::uptime()?;
|
||||||
|
|
||||||
// do things with the retrieved values...
|
// do things with the retrieved values...
|
||||||
|
|
||||||
|
|
|
@ -16,15 +16,15 @@
|
||||||
//! ## Example Usage
|
//! ## Example Usage
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! use peach_stats::StatsError;
|
//! use peach_stats::{stats, StatsError};
|
||||||
//!
|
//!
|
||||||
//! fn main() -> Result<(), StatsError> {
|
//! fn main() -> Result<(), StatsError> {
|
||||||
//! let cpu = peach_stats::cpu_stats()?;
|
//! let cpu = stats::cpu_stats()?;
|
||||||
//! let cpu_percentages = peach_stats::cpu_stats_percent()?;
|
//! let cpu_percentages = stats::cpu_stats_percent()?;
|
||||||
//! let disks = peach_stats::disk_usage()?;
|
//! let disks = stats::disk_usage()?;
|
||||||
//! let load = peach_stats::load_average()?;
|
//! let load = stats::load_average()?;
|
||||||
//! let mem = peach_stats::mem_stats()?;
|
//! let mem = stats::mem_stats()?;
|
||||||
//! let uptime = peach_stats::uptime()?;
|
//! let uptime = stats::uptime()?;
|
||||||
//!
|
//!
|
||||||
//! Ok(())
|
//! Ok(())
|
||||||
//! }
|
//! }
|
||||||
|
|
Loading…
Reference in New Issue