Skip to content

Commit a505f9b

Browse files
committed
chore(benches): use dedicated ports
1 parent c8eddbf commit a505f9b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ See [examples](https://github.com/loyd/clickhouse.rs/tree/master/examples).
209209
## Feature Flags
210210
* `lz4` (enabled by default) — enables `Compression::Lz4` and `Compression::Lz4Hc(_)` variants. If enabled, `Compression::Lz4` is used by default for all queries except for `WATCH`.
211211
* `tls` (enabled by default) — supports urls with the `HTTPS` schema.
212-
* `quanta` (enabled by default) - uses the [`quanta`](https://docs.rs/quanta) crate to speed the inserter up. Not used if `test-util` is enabled (thus, time can be managed by `tokio::time::advance()` in custom tests).
212+
* `quanta` (enabled by default) - uses the [quanta](https://docs.rs/quanta) crate to speed the inserter up. Not used if `test-util` is enabled (thus, time can be managed by `tokio::time::advance()` in custom tests).
213213
* `test-util` — adds mocks. See [the example](https://github.com/loyd/clickhouse.rs/tree/master/examples/mock.rs). Use it only in `dev-dependencies`.
214214
* `watch` — enables `client.watch` functionality. See the corresponding section for details.
215215
* `uuid` — adds `serde::uuid` to work with [uuid](https://docs.rs/uuid) crate.

benches/insert.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ async fn run_inserter(client: Client, iters: u64) -> Result<Duration> {
8686
Ok(start.elapsed())
8787
}
8888

89-
fn run<F>(c: &mut Criterion, name: &str, f: impl Fn(Client, u64) -> F)
89+
fn run<F>(c: &mut Criterion, name: &str, port: u16, f: impl Fn(Client, u64) -> F)
9090
where
9191
F: Future<Output = Result<Duration>>,
9292
{
93-
let addr = "127.0.0.1:6543".parse().unwrap();
93+
let addr = format!("127.0.0.1:{port}").parse().unwrap();
9494
server::start(addr);
9595

9696
let mut group = c.benchmark_group(name);
@@ -128,11 +128,11 @@ where
128128
}
129129

130130
fn insert(c: &mut Criterion) {
131-
run(c, "insert", run_insert);
131+
run(c, "insert", 6543, run_insert);
132132
}
133133

134134
fn inserter(c: &mut Criterion) {
135-
run(c, "inserter", run_inserter);
135+
run(c, "inserter", 6544, run_inserter);
136136
}
137137

138138
criterion_group!(benches, insert, inserter);

0 commit comments

Comments
 (0)