Skip to content

Commit

Permalink
style: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
bpetit committed Dec 22, 2020
1 parent 33a451c commit 108aaac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/exporters/prometheus.rs
Expand Up @@ -195,7 +195,7 @@ async fn show_metrics(data: web::Data<PowerMetrics>) -> impl Responder {
String::from(metric_name),
format_metric(metric_name, &metric_value.to_string(), None),
);
}
}

let metric_gathering = procfs::process::Process::myself().unwrap().statm();
if let Ok(metric_value) = metric_gathering {
Expand Down Expand Up @@ -270,7 +270,8 @@ async fn show_metrics(data: web::Data<PowerMetrics>) -> impl Responder {
body,
String::from("Number of energy consumption Records stored for each socket"),
String::from("gauge"),
String::from(metric_name), format_metric(
String::from(metric_name),
format_metric(
metric_name,
&s.record_buffer.len().to_string(),
Some(&labels),
Expand Down
6 changes: 3 additions & 3 deletions src/sensors/utils.rs
Expand Up @@ -290,9 +290,9 @@ impl ProcessTracker {
fn drop_empty_process_records_vectors(&mut self) {
let procs = &mut self.procs;
if !procs.is_empty() {
for i in 0..(procs.len()-1) {
if let Some(v) = procs.get(i) {
if v.is_empty() {
for i in 0..(procs.len() - 1) {
if let Some(v) = procs.get(i) {
if v.is_empty() {
procs.remove(i);
}
}
Expand Down

0 comments on commit 108aaac

Please sign in to comment.