Skip to content

Commit

Permalink
0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mrceperka committed Feb 24, 2022
1 parent 269fc16 commit 0df1624
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "process-exporter"
version = "0.3.0"
version = "0.4.0"
edition = "2021"

[dependencies]
prometheus = "0.13"
sysinfo = "0.21"
sysinfo = "0.23"
clap = "2.3"
regex = "1.5"
lazy_static = "1.4"
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# process-exporter

[![build](https://github.com/mrceperka/process-exporter/actions/workflows/rust.yml/badge.svg)](https://github.com/mrceperka/process-exporter/actions/workflows/rust.yml)

```sh
cargo run
# go to localhost:9333
```

Check http://localhost:9333/metrics

## usage

```sh
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use regex::Regex;
use std::error::Error;
use std::net::SocketAddr;
use std::sync::{Arc, Mutex};
use sysinfo::{ProcessExt, RefreshKind, System, SystemExt};
use sysinfo::{ProcessExt, ProcessRefreshKind, RefreshKind, System, SystemExt};

#[derive(Debug, Clone)]
struct Range {
Expand Down Expand Up @@ -250,7 +250,9 @@ async fn main() -> Result<(), Box<dyn Error>> {
_ => None,
};

let refresh_kind = RefreshKind::new().with_processes().with_memory();
let refresh_kind = RefreshKind::new()
.with_processes(ProcessRefreshKind::everything())
.with_memory();
let mut sys = System::new_with_specifics(refresh_kind);
sys.refresh_processes();
sys.refresh_memory();
Expand Down

0 comments on commit 0df1624

Please sign in to comment.