mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
bencher: pretty-print RSS
This commit is contained in:
parent
3d9a35d376
commit
98ce4ca019
5 changed files with 35 additions and 7 deletions
21
Cargo.lock
generated
21
Cargo.lock
generated
|
|
@ -135,6 +135,7 @@ dependencies = [
|
||||||
"aquatic_udp",
|
"aquatic_udp",
|
||||||
"aquatic_udp_load_test",
|
"aquatic_udp_load_test",
|
||||||
"clap 4.4.11",
|
"clap 4.4.11",
|
||||||
|
"humanize-bytes",
|
||||||
"indexmap 2.1.0",
|
"indexmap 2.1.0",
|
||||||
"indoc",
|
"indoc",
|
||||||
"itertools 0.12.0",
|
"itertools 0.12.0",
|
||||||
|
|
@ -1398,6 +1399,15 @@ version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
|
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "humanize-bytes"
|
||||||
|
version = "1.0.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5c8f5a0ffae64f844e5e311016d1d8184dd496c7136af420f665a877ac2f0681"
|
||||||
|
dependencies = [
|
||||||
|
"smartstring",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hwloc"
|
name = "hwloc"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
|
|
@ -2605,6 +2615,17 @@ version = "1.11.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
|
checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "smartstring"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
"static_assertions",
|
||||||
|
"version_check",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "snafu"
|
name = "snafu"
|
||||||
version = "0.7.5"
|
version = "0.7.5"
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ aquatic_udp_load_test = { optional = true, workspace = true }
|
||||||
|
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
clap = { version = "4", features = ["derive"] }
|
clap = { version = "4", features = ["derive"] }
|
||||||
|
humanize-bytes = "1"
|
||||||
indexmap = "2"
|
indexmap = "2"
|
||||||
indoc = "2"
|
indoc = "2"
|
||||||
itertools = "0.12"
|
itertools = "0.12"
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
use humanize_bytes::humanize_bytes_binary;
|
||||||
use indexmap::{IndexMap, IndexSet};
|
use indexmap::{IndexMap, IndexSet};
|
||||||
use indoc::formatdoc;
|
use indoc::formatdoc;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
|
|
@ -198,7 +199,7 @@ pub fn html_all_runs(all_results: &[TrackerCoreCountResults]) -> String {
|
||||||
<td>{avg_responses}</td>
|
<td>{avg_responses}</td>
|
||||||
{tracker_key_values}
|
{tracker_key_values}
|
||||||
<td>{cpu}%</td>
|
<td>{cpu}%</td>
|
||||||
<td>{mem} kB</td>
|
<td>{mem}</td>
|
||||||
<td>{tracker_vcpus}</td>
|
<td>{tracker_vcpus}</td>
|
||||||
{load_test_key_values}
|
{load_test_key_values}
|
||||||
<td>{load_test_vcpus}</td>
|
<td>{load_test_vcpus}</td>
|
||||||
|
|
@ -212,7 +213,8 @@ pub fn html_all_runs(all_results: &[TrackerCoreCountResults]) -> String {
|
||||||
}).join("\n"),
|
}).join("\n"),
|
||||||
cpu = r.tracker_stats.map(|stats| stats.avg_cpu_utilization.to_string())
|
cpu = r.tracker_stats.map(|stats| stats.avg_cpu_utilization.to_string())
|
||||||
.unwrap_or_else(|| "-".to_string()),
|
.unwrap_or_else(|| "-".to_string()),
|
||||||
mem = r.tracker_stats.map(|stats| stats.peak_rss_kb.to_string())
|
mem = r.tracker_stats
|
||||||
|
.map(|stats| humanize_bytes_binary!(stats.peak_rss_bytes).to_string())
|
||||||
.unwrap_or_else(|| "-".to_string()),
|
.unwrap_or_else(|| "-".to_string()),
|
||||||
tracker_vcpus = r.tracker_vcpus,
|
tracker_vcpus = r.tracker_vcpus,
|
||||||
load_test_key_values = load_test_key_names.iter().map(|name| {
|
load_test_key_values = load_test_key_names.iter().map(|name| {
|
||||||
|
|
|
||||||
|
|
@ -315,7 +315,7 @@ impl<C> std::fmt::Display for RunErrorResults<C> {
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
pub struct ProcessStats {
|
pub struct ProcessStats {
|
||||||
pub avg_cpu_utilization: f32,
|
pub avg_cpu_utilization: f32,
|
||||||
pub peak_rss_kb: f32,
|
pub peak_rss_bytes: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FromStr for ProcessStats {
|
impl FromStr for ProcessStats {
|
||||||
|
|
@ -324,9 +324,12 @@ impl FromStr for ProcessStats {
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
let mut parts = s.trim().split_whitespace();
|
let mut parts = s.trim().split_whitespace();
|
||||||
|
|
||||||
|
let avg_cpu_utilization = parts.next().ok_or(())?.parse().map_err(|_| ())?;
|
||||||
|
let peak_rss_kb: f32 = parts.next().ok_or(())?.parse().map_err(|_| ())?;
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
avg_cpu_utilization: parts.next().ok_or(())?.parse().map_err(|_| ())?,
|
avg_cpu_utilization,
|
||||||
peak_rss_kb: parts.next().ok_or(())?.parse().map_err(|_| ())?,
|
peak_rss_bytes: (peak_rss_kb * 1000.0) as u64,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
use humanize_bytes::humanize_bytes_binary;
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use num_format::{Locale, ToFormattedString};
|
use num_format::{Locale, ToFormattedString};
|
||||||
|
|
||||||
|
|
@ -207,8 +208,8 @@ impl LoadTestRunResults {
|
||||||
r.tracker_process_stats.avg_cpu_utilization,
|
r.tracker_process_stats.avg_cpu_utilization,
|
||||||
);
|
);
|
||||||
println!(
|
println!(
|
||||||
"- Peak tracker RSS: {} kB",
|
"- Peak tracker RSS: {}",
|
||||||
r.tracker_process_stats.peak_rss_kb
|
humanize_bytes_binary!(r.tracker_process_stats.peak_rss_bytes)
|
||||||
);
|
);
|
||||||
|
|
||||||
LoadTestRunResults::Success(LoadTestRunResultsSuccess {
|
LoadTestRunResults::Success(LoadTestRunResultsSuccess {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue