File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ serde_json.workspace = true
3939clap.workspace = true
4040mimalloc = { workspace = true , optional = true }
4141rustls = { workspace = true , optional = true }
42+ sysinfo.workspace = true
4243
4344[target .'cfg(not(windows))' .dependencies ]
4445tikv-jemallocator = { workspace = true , optional = true }
@@ -134,6 +135,7 @@ slotmap = "1.0.7"
134135smallvec = { version = " 1.15" , features = [" union" ] }
135136socket2 = { version = " 0.6.1" , features = [" all" ] }
136137syn = { version = " 2.0" , features = [" full" , " extra-traits" ] }
138+ sysinfo = " 0.37"
137139tempfile = " 3"
138140thiserror = " 2.0.17"
139141tracing = { version = " >=0.1.40" , default-features = false }
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use otap_df_config::{PipelineGroupId, PipelineId};
1010use otap_df_controller:: Controller ;
1111use otap_df_otap:: OTAP_PIPELINE_FACTORY ;
1212use std:: path:: PathBuf ;
13+ use sysinfo:: System ;
1314
1415#[ cfg( all(
1516 not( windows) ,
@@ -196,6 +197,11 @@ fn system_info() -> String {
196197 "system"
197198 } ;
198199
200+ let mut sys = System :: new_all ( ) ;
201+ sys. refresh_memory ( ) ;
202+ let total_memory_gb = sys. total_memory ( ) as f64 / 1_073_741_824.0 ;
203+ let available_memory_gb = sys. available_memory ( ) as f64 / 1_073_741_824.0 ;
204+
199205 let debug_warning = if cfg ! ( debug_assertions) {
200206 "\n \n ⚠️ WARNING: This binary was compiled in debug mode.
201207 Debug builds are NOT recommended for production, benchmarks, or performance testing.
@@ -231,6 +237,7 @@ fn system_info() -> String {
231237 format ! (
232238 "System Information:
233239 Available CPU cores: {}
240+ Available memory: {:.2} GB / {:.2} GB
234241 Build mode: {}
235242 Memory allocator: {}
236243
@@ -241,6 +248,8 @@ Available Plugin URNs:
241248
242249Configuration files can be found in the configs/ directory.{}" ,
243250 available_cores,
251+ available_memory_gb,
252+ total_memory_gb,
244253 build_mode,
245254 memory_allocator,
246255 receivers_sorted. join( ", " ) ,
You can’t perform that action at this time.
0 commit comments