add sbot docs and bump version

This commit is contained in:
glyph 2022-01-25 11:39:28 +02:00
parent 816d6c8a73
commit e1aa7b1bb6
2 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "peach-stats"
version = "0.2.0"
version = "0.3.0"
authors = ["Andrew Reid <glyph@mycelial.technology>"]
edition = "2018"
description = "Query system statistics. Provides a wrapper around the probes and systemstat crates."

View File

@ -1,10 +1,10 @@
# peach-stats
![Generic badge](https://img.shields.io/badge/version-0.2.0-<COLOR>.svg)
![Generic badge](https://img.shields.io/badge/version-0.3.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.
Currently offers the following statistics and associated data structures:
Currently offers the following system statistics and associated data structures:
- CPU: `user`, `system`, `nice`, `idle` (as values or percentages)
- Disk usage: `filesystem`, `one_k_blocks`, `one_k_blocks_used`,
@ -13,10 +13,14 @@ Currently offers the following statistics and associated data structures:
- Memory: `total`, `free`, `used`
- Uptime: `seconds`
As well as the following go-sbot process statistics:
- Sbot: `state`, `memory`, `uptime`, `downtime`
## Example Usage
```rust
use peach_stats::{stats, StatsError};
use peach_stats::{sbot, stats, StatsError};
fn main() -> Result<(), StatsError> {
let cpu = stats::cpu_stats()?;
@ -25,6 +29,7 @@ fn main() -> Result<(), StatsError> {
let load = stats::load_average()?;
let mem = stats::mem_stats()?;
let uptime = stats::uptime()?;
let sbot_process = sbot::sbot_stats()?;
// do things with the retrieved values...