Skip to content

Commit

Permalink
Add topolocy stats
Browse files Browse the repository at this point in the history
  • Loading branch information
papey committed Mar 11, 2023
1 parent 5002e6b commit b7de5c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/exporters/elastic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ const ES_INDEX_NAME: &str = "scaphandre";
#[derive(Debug, Serialize, Deserialize, PartialEq)]
pub struct ScaphandreData {
pub scaphandre_version: String,
pub scaphandre_topo_stats_nb: i32,
pub scaphandre_topo_records_nb: i32,
pub scaphandre_topo_procs_nb: i32,
pub scaphandre_cpu_usage_percentage: Option<u32>,
pub scaphandre_mem_total_program_size: Option<u64>,
pub scaphrandre_mem_resident_set_size: Option<u64>,
Expand Down Expand Up @@ -155,6 +158,9 @@ impl ElasticExporter {
))
.body(ScaphandreData {
scaphandre_version: get_scaphandre_version(),
scaphandre_topo_stats_nb: self.topology.stat_buffer.len() as i32,
scaphandre_topo_records_nb: self.topology.record_buffer.len() as i32,
scaphandre_topo_procs_nb: self.topology.proc_tracker.procs.len() as i32,
scaphandre_cpu_usage_percentage: self.get_scaphandre_cpu_usage_percentage(),
scaphandre_mem_total_program_size: self.get_scaphandre_mem_total_program_size(),
scaphrandre_mem_resident_set_size: self.get_scaphandre_mem_resident_set_size(),
Expand Down

0 comments on commit b7de5c6

Please sign in to comment.