Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert lading configuration from toml to yaml, remove rayon #119

Merged
merged 3 commits into from
Nov 23, 2021
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
94 changes: 37 additions & 57 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,3 @@
This project is a suite of tools used for data generation and load testing,
primarily of the [vector](https://github.com/timberio/vector/) project today but
maybe useful for you too.

Please see the READMEs of the sub-projects for more details:

* [`lading_common`](lading_common/README.md)
* [`file_gen`](file_gen/README.md)
* [`http_gen`](http_gen/README.md)
* [`udp_blackhole`](udp_blackhole/README.md)
4 changes: 2 additions & 2 deletions lading_blackholes/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lading_blackholes"
version = "0.5.3"
version = "0.6.0"
authors = ["Brian L. Troutwine <brian@troutwine.us>"]
edition = "2018"
license = "MIT"
Expand All @@ -13,7 +13,7 @@ description = "Blackhole programs with some instrumentation"
tower = { version = "0.4", default-features = false, features = ["timeout", "limit", "load-shed"] }
metrics = { version = "0.17", default-features = false, features = ["std"] }
metrics-exporter-prometheus = { version = "0.6", default-features = false, features = ["tokio-exporter"] }
toml = "0.5"
serde_yaml = "0.8"
serde_qs = "0.8.5"
rand = "0.8.4"

Expand Down
8 changes: 4 additions & 4 deletions lading_blackholes/src/bin/http_blackhole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn default_concurrent_requests_max() -> usize {
}

fn default_config_path() -> String {
"/etc/lading/http_blackhole.toml".to_string()
"/etc/lading/http_blackhole.yaml".to_string()
}

#[derive(Debug, Copy, Clone, Deserialize)]
Expand Down Expand Up @@ -77,15 +77,15 @@ struct HttpServer {
}

#[derive(Serialize)]
#[serde(rename_all = "PascalCase")]
#[serde(rename_all = "snake_case")]
struct KinesisPutRecordBatchResponseEntry {
error_code: Option<String>,
error_message: Option<String>,
record_id: String,
}

#[derive(Serialize)]
#[serde(rename_all = "PascalCase")]
#[serde(rename_all = "snake_case")]
struct KinesisPutRecordBatchResponse {
encrypted: Option<bool>,
failed_put_count: u32,
Expand Down Expand Up @@ -177,7 +177,7 @@ fn get_config() -> Config {
.unwrap();
let mut contents = String::new();
file.read_to_string(&mut contents).unwrap();
toml::from_str(&contents).unwrap()
serde_yaml::from_str(&contents).unwrap()
}

fn main() {
Expand Down
4 changes: 2 additions & 2 deletions lading_blackholes/src/bin/splunk_hec_blackhole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn default_concurrent_requests_max() -> usize {
}

fn default_config_path() -> String {
"/etc/lading/splunk_hec_blackhole.toml".to_string()
"/etc/lading/splunk_hec_blackhole.yaml".to_string()
}

#[derive(FromArgs)]
Expand Down Expand Up @@ -53,7 +53,7 @@ struct Config {
fn get_config() -> Config {
let opts = argh::from_env::<Opts>();
let contents = read_to_string(&opts.config_path).unwrap();
toml::from_str::<Config>(&contents).unwrap()
serde_yaml::from_str::<Config>(&contents).unwrap()
}

struct SplunkHecServer {
Expand Down
9 changes: 4 additions & 5 deletions lading_blackholes/src/bin/sqs_blackhole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use tokio::time::Duration;
use tower::ServiceBuilder;

fn default_config_path() -> String {
"/etc/lading/sqs_blackhole.toml".to_string()
"/etc/lading/sqs_blackhole.yaml".to_string()
}

fn default_concurrent_requests_max() -> usize {
Expand Down Expand Up @@ -51,7 +51,7 @@ fn get_config() -> Config {
.unwrap();
let mut contents = String::new();
file.read_to_string(&mut contents).unwrap();
toml::from_str(&contents).unwrap()
serde_yaml::from_str(&contents).unwrap()
}

struct HttpServer {
Expand All @@ -73,9 +73,8 @@ impl HttpServer {
.install()
.unwrap();

let service = make_service_fn(|_: &AddrStream| async move {
Ok::<_, hyper::Error>(service_fn(move |request| srv(request)))
});
let service =
make_service_fn(|_: &AddrStream| async move { Ok::<_, hyper::Error>(service_fn(srv)) });
let svc = ServiceBuilder::new()
.load_shed()
.concurrency_limit(concurrency_limit)
Expand Down
4 changes: 2 additions & 2 deletions lading_blackholes/src/bin/udp_blackhole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use tokio::net::UdpSocket;
use tokio::runtime::Builder;

fn default_config_path() -> String {
"/etc/lading/udp_blackhole.toml".to_string()
"/etc/lading/udp_blackhole.yaml".to_string()
}

#[derive(FromArgs)]
Expand Down Expand Up @@ -65,7 +65,7 @@ fn get_config() -> Config {
.unwrap();
let mut contents = String::new();
file.read_to_string(&mut contents).unwrap();
toml::from_str(&contents).unwrap()
serde_yaml::from_str(&contents).unwrap()
}

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion lading_common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lading_common"
version = "0.5.3"
version = "0.6.0"
authors = ["Brian L. Troutwine <brian@troutwine.us>"]
edition = "2018"
license = "MIT"
Expand Down
5 changes: 2 additions & 3 deletions lading_generators/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "lading_generators"
readme = "README.md"
version = "0.5.3"
version = "0.6.0"
authors = ["Brian L. Troutwine <brian@troutwine.us>"]
edition = "2018"
license = "MIT"
Expand All @@ -12,8 +12,7 @@ description = "Generating programs with stable throughput."

[dependencies]
lading_common = { path = "../lading_common" }
rayon = "1.5"
toml = "0.5"
serde_yaml = "0.8"

[dependencies.argh]
version = "0.1"
Expand Down
Loading