merge stats changes
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2602,7 +2602,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "peach-stats"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"log 0.4.14",
|
||||
"miniserde",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "peach-stats"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
authors = ["Andrew Reid <glyph@mycelial.technology>"]
|
||||
edition = "2018"
|
||||
description = "Query system statistics. Provides a wrapper around the probes and systemstat crates."
|
||||
|
@ -1,6 +1,6 @@
|
||||
# peach-stats
|
||||
|
||||

|
||||

|
||||
|
||||
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
|
||||
|
||||
```rust
|
||||
use peach_stats::StatsError;
|
||||
use peach_stats::{stats, StatsError};
|
||||
|
||||
fn main() -> Result<(), StatsError> {
|
||||
let cpu = peach_stats::cpu_stats()?;
|
||||
let cpu_percentages = peach_stats::cpu_stats_percent()?;
|
||||
let disks = peach_stats::disk_usage()?;
|
||||
let load = peach_stats::load_average()?;
|
||||
let mem = peach_stats::mem_stats()?;
|
||||
let uptime = peach_stats::uptime()?;
|
||||
let cpu = stats::cpu_stats()?;
|
||||
let cpu_percentages = stats::cpu_stats_percent()?;
|
||||
let disks = stats::disk_usage()?;
|
||||
let load = stats::load_average()?;
|
||||
let mem = stats::mem_stats()?;
|
||||
let uptime = stats::uptime()?;
|
||||
|
||||
// do things with the retrieved values...
|
||||
|
||||
|
@ -16,15 +16,15 @@
|
||||
//! ## Example Usage
|
||||
//!
|
||||
//! ```rust
|
||||
//! use peach_stats::StatsError;
|
||||
//! use peach_stats::{stats, StatsError};
|
||||
//!
|
||||
//! fn main() -> Result<(), StatsError> {
|
||||
//! let cpu = peach_stats::cpu_stats()?;
|
||||
//! let cpu_percentages = peach_stats::cpu_stats_percent()?;
|
||||
//! let disks = peach_stats::disk_usage()?;
|
||||
//! let load = peach_stats::load_average()?;
|
||||
//! let mem = peach_stats::mem_stats()?;
|
||||
//! let uptime = peach_stats::uptime()?;
|
||||
//! let cpu = stats::cpu_stats()?;
|
||||
//! let cpu_percentages = stats::cpu_stats_percent()?;
|
||||
//! let disks = stats::disk_usage()?;
|
||||
//! let load = stats::load_average()?;
|
||||
//! let mem = stats::mem_stats()?;
|
||||
//! let uptime = stats::uptime()?;
|
||||
//!
|
||||
//! Ok(())
|
||||
//! }
|
||||
|
Reference in New Issue
Block a user