Skip to content

Commit cb22d81

Browse files
committed
RUST-541 Include async runtime information in client metadata (#240)
1 parent 751321b commit cb22d81

File tree

1 file changed

+10
-1
lines changed
  • src/cmap/establish/handshake

1 file changed

+10
-1
lines changed

src/cmap/establish/handshake/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ use crate::{
1111
is_master::IsMasterReply,
1212
};
1313

14+
#[cfg(feature = "tokio-runtime")]
15+
const RUNTIME_NAME: &str = "tokio";
16+
17+
#[cfg(all(feature = "async-std-runtime", not(feature = "sync")))]
18+
const RUNTIME_NAME: &str = "async-std";
19+
20+
#[cfg(feature = "sync")]
21+
const RUNTIME_NAME: &str = "sync (with async-std)";
22+
1423
#[derive(Clone, Debug)]
1524
struct ClientMetadata {
1625
application: Option<AppMetadata>,
@@ -114,7 +123,7 @@ lazy_static! {
114123

115124
if let Some((version, channel, date)) = version_check::triple() {
116125
metadata.platform =
117-
Some(format!("rustc {} {} ({})", version, channel, date));
126+
Some(format!("rustc {} {} ({}) with {}", version, channel, date, RUNTIME_NAME));
118127
}
119128

120129
metadata

0 commit comments

Comments
 (0)