Remove Aggregated label in stats (#1788)

* Remove Aggregated label in stats

* introspection

* fix monitor aggregate propagation
This commit is contained in:
Andrea Fioraldi 2024-01-10 21:05:19 +01:00 committed by GitHub
parent b93a5bb414
commit aaeeead574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 12 deletions

View File

@ -521,16 +521,16 @@ where
// If we are measuring scalability stuff..
#[cfg(feature = "scalability_introspection")]
{
let imported_with_observer = state.scalability_monitor().testcase_with_observers;
let imported_without_observer = state.scalability_monitor().testcase_without_observers;
let received_with_observer = state.scalability_monitor().testcase_with_observers;
let received_without_observer = state.scalability_monitor().testcase_without_observers;
self.fire(
state,
Event::UpdateUserStats {
name: "total imported".to_string(),
name: "total received".to_string(),
value: UserStats::new(
UserStatsValue::Number(
(imported_with_observer + imported_without_observer) as u64,
(received_with_observer + received_without_observer) as u64,
),
AggregatorOps::Avg,
),

View File

@ -48,6 +48,10 @@ where
self.base.set_start_time(time);
}
fn aggregate(&mut self, name: &str) {
self.base.aggregate(name);
}
fn display(&mut self, event_msg: String, sender_id: ClientId) {
let cur_time = current_time();

View File

@ -1,9 +1,8 @@
//! Monitor to display both cumulative and per-client monitor
use alloc::{
string::{String, ToString},
vec::Vec,
};
#[cfg(feature = "introspection")]
use alloc::string::ToString;
use alloc::{string::String, vec::Vec};
use core::{
fmt::{Debug, Formatter, Write},
time::Duration,
@ -84,11 +83,9 @@ where
self.total_execs(),
self.execs_per_sec_pretty()
);
let mut aggregated_fmt = " (Aggregated):".to_string();
for (key, val) in &self.aggregator.aggregated {
write!(aggregated_fmt, " {key}: {val}").unwrap();
write!(global_fmt, ", {key}: {val}").unwrap();
}
write!(global_fmt, "{aggregated_fmt}").unwrap();
(self.print_fn)(global_fmt);

View File

@ -400,7 +400,6 @@ impl Monitor for TuiMonitor {
for (key, val) in &client.user_monitor {
write!(fmt, ", {key}: {val}").unwrap();
}
write!(fmt, ", (Aggregated):").unwrap();
for (key, val) in &self.aggregator.aggregated {
write!(fmt, ", {key}: {val}").unwrap();
}