Skip to content

Commit b411f62

Browse files
authored
Merge pull request #9148 from BohuTANG/dev-print-cluster
feat: print memory limit and cluster info when query start
2 parents 0a90276 + 6bfecc9 commit b411f62

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/binaries/query/main.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,26 @@ async fn main_entrypoint() -> Result<()> {
205205
format!("connected to endpoints {:#?}", conf.meta.endpoints)
206206
}
207207
);
208+
println!(
209+
"Memory: {}",
210+
if conf.query.max_memory_limit_enabled {
211+
format!(
212+
"Memory: server memory limit to {} (bytes)",
213+
conf.query.max_server_memory_usage
214+
)
215+
} else {
216+
"unlimited".to_string()
217+
}
218+
);
219+
println!("Cluster: {}", {
220+
let cluster = ClusterDiscovery::instance().discover(&conf).await?;
221+
let nodes = cluster.nodes.len();
222+
if nodes > 1 {
223+
format!("[{}] nodes", nodes)
224+
} else {
225+
"standalone".to_string()
226+
}
227+
});
208228
println!("Storage: {}", conf.storage.params);
209229
println!("Cache: {}", conf.storage.cache.params);
210230
println!(

0 commit comments

Comments
 (0)