mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
udp load test: enable log crate logging
This commit is contained in:
parent
57896f4648
commit
6eaac536ba
2 changed files with 8 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue