Skip to content

Commit af8235b

Browse files
authored
Merge pull request #69 from niccantieni/qlog
qlog: initial setup
2 parents 1789796 + 31c5a4a commit af8235b

13 files changed

Lines changed: 109 additions & 8 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
.envrc
44
.clangd
55
__pycache__
6-
static_dependencies/
6+
static_dependencies/
7+
qlog

Cargo.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,16 @@ export NQ_LIBS="quinn quiche neqo"
5454
script/dashboard.sh
5555
# update run.sh to the correct CPU-range; if you are running a bare-metal
5656
# benchmark, enable NESQUIC_BENACHMARK=1.
57+
5758
# run the test scenarios for a given library
58-
# the label can be used later to identify past runs. If no value is supplied,
59+
# NESQUIC_RUN_LABEL can be used later to identify past runs. If no value is supplied,
5960
# the label is set to "default".
60-
NESQUIC_RUN_LABEL=firstRun script/run.sh quinn quiche
61+
62+
# if QLOG_DIR is set, qlog-traces will be written to that directory
63+
# if QLOG_DIR is unset, no qlog-traces are written
64+
# currently, only quiche, quinn and neqo produce qlog.
65+
# For neqo, the flag is ignored.
66+
NESQUIC_RUN_LABEL=firstRun QLOG_DIR="qlog" script/run.sh quinn quiche noq neqo
6167
```
6268

6369
This starts the Grafana dashboard and executes a performance test. The dashboard is hosted at `http://localhost:3000`

iut/common/quinn-noq/client.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ impl bin::Client for Client {
2323

2424
client_crypto.alpn_protocols = vec![b"perf".to_vec()];
2525

26-
let config = ClientConfig::new(Arc::new(QuicClientConfig::try_from(client_crypto)?));
26+
let mut config = ClientConfig::new(Arc::new(QuicClientConfig::try_from(client_crypto)?));
27+
28+
if let Some(ref dir) = args.qlog {
29+
let transport = crate::setup_qlog_transport(dir, "client")?;
30+
config.transport_config(Arc::new(transport));
31+
}
2732

2833
Ok(Client {
2934
args,

iut/common/quinn-noq/server.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ impl bin::Server for Server {
2626
.with_single_cert(certs, key)?;
2727
server_crypto.alpn_protocols = vec![b"perf".to_vec()];
2828

29-
let config = ServerConfig::with_crypto(Arc::new(QuicServerConfig::try_from(server_crypto)?));
29+
let mut config = ServerConfig::with_crypto(Arc::new(QuicServerConfig::try_from(server_crypto)?));
30+
31+
if let Some(ref dir) = args.qlog {
32+
let transport = crate::setup_qlog_transport(dir, "server")?;
33+
config.transport_config(Arc::new(transport));
34+
}
3035

3136
Ok(Server { args, config })
3237
}

iut/noq/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
anyhow = "1.0.102"
88
bytes = "1.11.1"
99
tracing = "0.1.44"
10-
noq = "0.17.0"
10+
noq = { version = "0.17.0", features = ["qlog"] }
1111
rustls = { version = "0.23.38", default-features = false, features = ["ring"] }
1212
socket2 = "0.6.3"
1313
tokio = { version = "1.51.1", features = ["macros", "full"] }

iut/noq/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ pub(crate) mod backend {
66
pub(crate) const CLIENT_TARGET: &str = "noq::client";
77
pub(crate) const SERVER_TARGET: &str = "noq::server";
88

9+
pub(crate) fn setup_qlog_transport(dir: &str, _role: &str) -> anyhow::Result<noq::TransportConfig> {
10+
let mut transport = noq::TransportConfig::default();
11+
transport.qlog_from_path(std::path::Path::new(dir), "");
12+
Ok(transport)
13+
}
14+
915
#[path = "../../common/quinn-noq/mod.rs"]
1016
mod common;
1117

iut/quiche/src/client.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ impl bin::Client for Client {
5151
let mut params = ConnectionParams::default();
5252
params.settings.alpn = vec![b"perf".to_vec()];
5353

54+
params.settings.qlog_dir = self.args.qlog.clone();
55+
5456
let (benchmark, send) = Benchmark::new();
5557
let Ok(qconn) = quic::connect_with_config(socket, None, &params, benchmark).await else {
5658
bail!("Failed to establish connection");

iut/quiche/src/server.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ impl bin::Server for Server {
2525
kind: tokio_quiche::settings::CertificateKind::X509,
2626
});
2727

28+
params.settings.qlog_dir = self.args.qlog.clone();
29+
2830
let mut listeners = tokio_quiche::listen([socket], params, DefaultMetrics)?;
2931
let accept = &mut listeners[0];
3032

iut/quinn/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
anyhow = "1.0.102"
88
bytes = "1.11.1"
99
tracing = "0.1.44"
10-
quinn = { version = "0.11.9", features = ["rustls"] }
10+
quinn = { version = "0.11.9", features = ["rustls", "qlog"] }
1111
quinn-proto = "0.11.14"
1212
rustls = { version = "0.23.38", default-features = false, features = ["ring"] }
1313
socket2 = "0.6.3"

0 commit comments

Comments
 (0)