Issue/105 (#106)

* fixed tests

* updated lock
This commit is contained in:
Francesco Cogno 2022-11-21 10:28:17 +01:00 committed by GitHub
parent 56290d6801
commit 2d82a9c06c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 13 deletions

2
Cargo.lock generated
View file

@ -512,7 +512,7 @@ dependencies = [
[[package]] [[package]]
name = "prometheus_wireguard_exporter" name = "prometheus_wireguard_exporter"
version = "3.6.5" version = "3.6.6"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "prometheus_wireguard_exporter" name = "prometheus_wireguard_exporter"
version = "3.6.5" version = "3.6.6"
authors = ["Francesco Cogno <francesco.cogno@outlook.com>"] authors = ["Francesco Cogno <francesco.cogno@outlook.com>"]
description = "Prometheus WireGuard Exporter" description = "Prometheus WireGuard Exporter"
edition = "2018" edition = "2018"

View file

@ -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) [![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) [![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.5) [![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) [![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) [![Docker build](https://github.com/MindFlavor/prometheus_wireguard_exporter/actions/workflows/docker.yml/badge.svg)](https://github.com/qdm12/godevcontainer/actions/workflows/docker.yml)

View file

@ -438,7 +438,7 @@ wg0\tsUsR6xufQQ8Tf0FuyY9tfEeYdhVMeFelr4ZMUrj+B0E=\t(none)\t10.211.123.128:51820\
extract_names_config_files: None, extract_names_config_files: None,
interfaces: None, interfaces: None,
export_remote_ip_and_port: true, 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); let s = a.render_with_names(Some(&pe), &options);
@ -564,8 +564,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
interfaces: HashMap::new(), interfaces: HashMap::new(),
}; };
let mut v = Vec::new(); let v = vec![re];
v.push(re);
wg.interfaces.insert("Pippo".to_owned(), v); wg.interfaces.insert("Pippo".to_owned(), v);
let options = Options { let options = Options {
@ -575,7 +574,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
extract_names_config_files: None, extract_names_config_files: None,
interfaces: None, interfaces: None,
export_remote_ip_and_port: true, export_remote_ip_and_port: true,
export_latest_handshake_delay: true, export_latest_handshake_delay: false,
}; };
let prometheus = wg.render_with_names(None, &options); let prometheus = wg.render_with_names(None, &options);
@ -620,9 +619,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
interfaces: HashMap::new(), interfaces: HashMap::new(),
}; };
let mut v = Vec::new(); let v = vec![re1, re2];
v.push(re1);
v.push(re2);
wg.interfaces.insert("Pippo".to_owned(), v); wg.interfaces.insert("Pippo".to_owned(), v);
let mut pehm = PeerEntryHashMap::new(); let mut pehm = PeerEntryHashMap::new();
@ -642,7 +639,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
extract_names_config_files: None, extract_names_config_files: None,
interfaces: None, interfaces: None,
export_remote_ip_and_port: true, 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); let prometheus = wg.render_with_names(Some(&pehm), &options);