Skip to content

Commit

Permalink
Issue/105 (#106)
Browse files Browse the repository at this point in the history
* fixed tests

* updated lock
  • Loading branch information
MindFlavor committed Nov 21, 2022
1 parent 56290d6 commit 2d82a9c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "prometheus_wireguard_exporter"
version = "3.6.5"
version = "3.6.6"
authors = ["Francesco Cogno <[email protected]>"]
description = "Prometheus WireGuard Exporter"
edition = "2018"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

[![Crate](https://img.shields.io/crates/v/prometheus_wireguard_exporter.svg)](https://crates.io/crates/prometheus_wireguard_exporter) [![cratedown](https://img.shields.io/crates/d/prometheus_wireguard_exporter.svg)](https://crates.io/crates/prometheus_wireguard_exporter) [![cratelastdown](https://img.shields.io/crates/dv/prometheus_wireguard_exporter.svg)](https://crates.io/crates/prometheus_wireguard_exporter)

[![release](https://img.shields.io/github/release/MindFlavor/prometheus_wireguard_exporter.svg)](https://github.com/MindFlavor/prometheus_wireguard_exporter/tree/3.6.5)
[![tag](https://img.shields.io/github/tag/mindflavor/prometheus_wireguard_exporter.svg)](https://github.com/MindFlavor/prometheus_wireguard_exporter/tree/3.6.5)
[![release](https://img.shields.io/github/release/MindFlavor/prometheus_wireguard_exporter.svg)](https://github.com/MindFlavor/prometheus_wireguard_exporter/tree/3.6.6)
[![tag](https://img.shields.io/github/tag/mindflavor/prometheus_wireguard_exporter.svg)](https://github.com/MindFlavor/prometheus_wireguard_exporter/tree/3.6.6)

[![Rust build](https://github.com/mindflavor/prometheus_wireguard_exporter/workflows/Rust/badge.svg)](https://github.com/mindflavor/prometheus_wireguard_exporter/actions?query=workflow%3ARust)
[![commitssince](https://img.shields.io/github/commits-since/mindflavor/prometheus_wireguard_exporter/3.6.5)](https://img.shields.io/github/commits-since/mindflavor/prometheus_wireguard_exporter/3.6.5)
[![commitssince](https://img.shields.io/github/commits-since/mindflavor/prometheus_wireguard_exporter/3.6.6)](https://img.shields.io/github/commits-since/mindflavor/prometheus_wireguard_exporter/3.6.6)

[![Docker build](https://github.com/MindFlavor/prometheus_wireguard_exporter/actions/workflows/docker.yml/badge.svg)](https://github.com/qdm12/godevcontainer/actions/workflows/docker.yml)

Expand Down
13 changes: 5 additions & 8 deletions src/wireguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ wg0\tsUsR6xufQQ8Tf0FuyY9tfEeYdhVMeFelr4ZMUrj+B0E=\t(none)\t10.211.123.128:51820\
extract_names_config_files: None,
interfaces: None,
export_remote_ip_and_port: true,
export_latest_handshake_delay: true,
export_latest_handshake_delay: false,
};

let s = a.render_with_names(Some(&pe), &options);
Expand Down Expand Up @@ -564,8 +564,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
interfaces: HashMap::new(),
};

let mut v = Vec::new();
v.push(re);
let v = vec![re];
wg.interfaces.insert("Pippo".to_owned(), v);

let options = Options {
Expand All @@ -575,7 +574,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
extract_names_config_files: None,
interfaces: None,
export_remote_ip_and_port: true,
export_latest_handshake_delay: true,
export_latest_handshake_delay: false,
};

let prometheus = wg.render_with_names(None, &options);
Expand Down Expand Up @@ -620,9 +619,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
interfaces: HashMap::new(),
};

let mut v = Vec::new();
v.push(re1);
v.push(re2);
let v = vec![re1, re2];
wg.interfaces.insert("Pippo".to_owned(), v);

let mut pehm = PeerEntryHashMap::new();
Expand All @@ -642,7 +639,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
extract_names_config_files: None,
interfaces: None,
export_remote_ip_and_port: true,
export_latest_handshake_delay: true,
export_latest_handshake_delay: false,
};

let prometheus = wg.render_with_names(Some(&pehm), &options);
Expand Down

0 comments on commit 2d82a9c

Please sign in to comment.