Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bleep
Original file line number Diff line number Diff line change
@@ -1 +1 @@
32a7a7b8037c590b5e845c24f12e74d02b4ead92
581a224bab00d4d8a554bf59136e2b62ad54a64b
2 changes: 1 addition & 1 deletion pingora-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rand = "0.8"
[dev-dependencies]
tokio-test = "0.4"
tokio = { workspace = true, features = ["fs"] }
env_logger = "0.9"
env_logger = "0.11"
dhat = "0"
futures = "0.3"

Expand Down
6 changes: 3 additions & 3 deletions pingora-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ http = { workspace = true }
log = { workspace = true }
h2 = { workspace = true }
derivative.workspace = true
clap = { version = "3.2.25", features = ["derive"] }
clap = { version = "4.5", features = ["derive"] }
once_cell = { workspace = true }
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8"
serde_yaml = "0.9"
strum = "0.26.2"
strum_macros = "0.26.2"
libc = "0.2.70"
Expand Down Expand Up @@ -83,7 +83,7 @@ windows-sys = { version = "0.59.0", features = ["Win32_Networking_WinSock"] }
[dev-dependencies]
h2 = { workspace = true, features = ["unstable"] }
tokio-stream = { version = "0.1", features = ["full"] }
env_logger = "0.9"
env_logger = "0.11"
reqwest = { version = "0.11", features = [
"rustls-tls",
], default-features = false }
Expand Down
11 changes: 10 additions & 1 deletion pingora-core/src/server/configuration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use clap::Parser;
use log::{debug, trace};
use pingora_error::{Error, ErrorType::*, OrErr, Result};
use serde::{Deserialize, Serialize};
use std::ffi::OsString;
use std::fs;

// default maximum upstream retries for retry-able proxy errors
Expand Down Expand Up @@ -161,7 +162,7 @@ pub struct Opt {

/// Not actually used. This flag is there so that the server is not upset seeing this flag
/// passed from `cargo test` sometimes
#[clap(long, hidden = true)]
#[clap(long, hide = true)]
pub nocapture: bool,

/// Test the configuration and exit
Expand Down Expand Up @@ -258,6 +259,14 @@ impl Opt {
pub fn parse_args() -> Self {
Opt::parse()
}

pub fn parse_from_args<I, T>(args: I) -> Self
where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
{
Opt::parse_from(args)
}
}

#[cfg(test)]
Expand Down
8 changes: 5 additions & 3 deletions pingora-ketama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ keywords = ["hash", "hashing", "consistent", "pingora"]

[dependencies]
crc32fast = "1.3"
i_key_sort = { version = "0.10.1", optional = true, features = ["allow_multithreading"] }

[dev-dependencies]
criterion = "0.4"
criterion = "0.7"
csv = "1.2"
dhat = "0.3"
env_logger = "0.9"
env_logger = "0.11"
log = { workspace = true }
rand = "0.8"
rand = "0.9.2"

[[bench]]
name = "simple"
Expand All @@ -30,3 +31,4 @@ harness = false

[features]
heap-prof = []
v2 = ["i_key_sort"]
13 changes: 6 additions & 7 deletions pingora-ketama/benches/simple.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use pingora_ketama::{Bucket, Continuum};

use criterion::{criterion_group, criterion_main, Criterion};
use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};
use rand::{
distr::{Alphanumeric, SampleString},
rng,
};

#[cfg(feature = "heap-prof")]
#[global_allocator]
Expand All @@ -19,11 +21,8 @@ fn buckets() -> Vec<Bucket> {
}

fn random_string() -> String {
thread_rng()
.sample_iter(&Alphanumeric)
.take(30)
.map(char::from)
.collect()
let mut rand = rng();
Alphanumeric.sample_string(&mut rand, 30)
}

pub fn criterion_benchmark(c: &mut Criterion) {
Expand Down
Loading