mirror of
https://github.com/greatest-ape/aquatic.git
synced 2026-10-22 17:31:15 +00:00
udp load test: enable log crate logging
This commit is contained in:
1 parent
57896f4648
commit
6eaac536ba
2 files changed
+8
-1
No files matched your search
@@ -1,6 +1,7 @@
|
||||
use std::net::SocketAddr;
|
||||
use std::sync::{atomic::AtomicUsize, Arc};
|
||||
|
||||
use aquatic_cli_helpers::LogLevel;
|
||||
use aquatic_common::cpu_pinning::CpuPinningConfig;
|
||||
use hashbrown::HashMap;
|
||||
use parking_lot::Mutex;
|
||||
@@ -16,6 +17,7 @@ pub struct ThreadId(pub u8);
|
||||
pub struct Config {
|
||||
/// Server address
|
||||
pub server_address: SocketAddr,
|
||||
pub log_level: LogLevel,
|
||||
/// Number of sockets and socket worker threads
|
||||
///
|
||||
/// Sockets will bind to one port each, and with
|
||||
@@ -102,6 +104,7 @@ impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
server_address: "127.0.0.1:3000".parse().unwrap(),
|
||||
log_level: LogLevel::Error,
|
||||
num_socket_workers: 1,
|
||||
num_request_workers: 1,
|
||||
duration: 0,
|
||||
|
||||
@@ -31,7 +31,11 @@ pub fn main() {
|
||||
)
|
||||
}
|
||||
|
||||
impl aquatic_cli_helpers::Config for Config {}
|
||||
impl aquatic_cli_helpers::Config for Config {
|
||||
fn get_log_level(&self) -> Option<aquatic_cli_helpers::LogLevel> {
|
||||
Some(self.log_level)
|
||||
}
|
||||
}
|
||||
|
||||
fn run(config: Config) -> ::anyhow::Result<()> {
|
||||
if config.handler.weight_announce + config.handler.weight_connect + config.handler.weight_scrape
|
||||
|
||||
Reference in new issue
Block a user