fix example code
This commit is contained in:
parent
8c3fecb875
commit
cfbf052d27
|
@ -1,6 +1,6 @@
|
|||
# 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.
|
||||
|
||||
|
@ -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(())
|
||||
//! }
|
||||
|
|
Loading…
Reference in New Issue