File tree Expand file tree Collapse file tree 4 files changed +18
-32
lines changed Expand file tree Collapse file tree 4 files changed +18
-32
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ pretty_reqwest_error = { workspace = true }
36
36
tokio = { workspace = true }
37
37
38
38
[target .'cfg(target_os = "linux")' .dependencies ]
39
- psutil = { version = " 3.2.2 " , optional = true }
39
+ psutil = { version = " 3.3.0 " , optional = true }
40
40
procfs = { version = " 0.15.1" , optional = true }
41
41
42
42
[features ]
Original file line number Diff line number Diff line change @@ -243,6 +243,8 @@ pub struct ProcessHealth {
243
243
pub pid_mem_resident_set_size : u64 ,
244
244
/// The total virtual memory used by this pid.
245
245
pub pid_mem_virtual_memory_size : u64 ,
246
+ /// The total shared memory used by this pid.
247
+ pub pid_mem_shared_memory_size : u64 ,
246
248
/// Number of cpu seconds consumed by this pid.
247
249
pub pid_process_seconds_total : u64 ,
248
250
}
@@ -277,6 +279,7 @@ impl ProcessHealth {
277
279
pid_num_threads : stat. num_threads ,
278
280
pid_mem_resident_set_size : process_mem. rss ( ) ,
279
281
pid_mem_virtual_memory_size : process_mem. vms ( ) ,
282
+ pid_mem_shared_memory_size : process_mem. shared ( ) ,
280
283
pid_process_seconds_total : process_times. busy ( ) . as_secs ( )
281
284
+ process_times. children_system ( ) . as_secs ( )
282
285
+ process_times. children_system ( ) . as_secs ( ) ,
Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ lazy_static::lazy_static! {
14
14
"process_virtual_memory_bytes" ,
15
15
"Virtual memory used by the current process"
16
16
) ;
17
+ pub static ref PROCESS_SHR_MEM : Result <IntGauge > = try_create_int_gauge(
18
+ "process_shared_memory_bytes" ,
19
+ "Shared memory used by the current process"
20
+ ) ;
17
21
pub static ref PROCESS_SECONDS : Result <IntGauge > = try_create_int_gauge(
18
22
"process_cpu_seconds_total" ,
19
23
"Total cpu time taken by the current process"
@@ -90,6 +94,7 @@ pub fn scrape_process_health_metrics() {
90
94
set_gauge ( & PROCESS_NUM_THREADS , health. pid_num_threads ) ;
91
95
set_gauge ( & PROCESS_RES_MEM , health. pid_mem_resident_set_size as i64 ) ;
92
96
set_gauge ( & PROCESS_VIRT_MEM , health. pid_mem_virtual_memory_size as i64 ) ;
97
+ set_gauge ( & PROCESS_SHR_MEM , health. pid_mem_shared_memory_size as i64 ) ;
93
98
set_gauge ( & PROCESS_SECONDS , health. pid_process_seconds_total as i64 ) ;
94
99
}
95
100
}
You can’t perform that action at this time.
0 commit comments