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

View File

@ -48,6 +48,10 @@ where
self.base.set_start_time(time); 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) { fn display(&mut self, event_msg: String, sender_id: ClientId) {
let cur_time = current_time(); let cur_time = current_time();

View File

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

View File

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