Change under load params, change localhost to IP

This commit is contained in:
Prabhpreet Dua
2024-04-16 12:16:30 +05:30
parent 65df24a98b
commit b07859f6ec
3 changed files with 5 additions and 14 deletions

View File

@@ -1,7 +1,6 @@
use anyhow::bail;
use anyhow::Result;
use clap::builder;
use derive_builder::Builder;
use log::{debug, error, info, warn};
use mio::Interest;
@@ -18,7 +17,6 @@ use std::net::SocketAddr;
use std::net::SocketAddrV4;
use std::net::SocketAddrV6;
use std::net::ToSocketAddrs;
use std::path::Display;
use std::path::PathBuf;
use std::process::Command;
use std::process::Stdio;
@@ -39,7 +37,7 @@ const IPV4_ANY_ADDR: Ipv4Addr = Ipv4Addr::new(0, 0, 0, 0);
const IPV6_ANY_ADDR: Ipv6Addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0);
const UNDER_LOAD_RATIO: f64 = 0.5;
const DURATION_UPDATE_UNDER_LOAD_STATUS: Duration = Duration::from_millis(100);
const DURATION_UPDATE_UNDER_LOAD_STATUS: Duration = Duration::from_millis(500);
fn ipv4_any_binding() -> SocketAddr {
// addr, port

View File

@@ -76,7 +76,6 @@ use std::{
};
use anyhow::{bail, ensure, Context, Result};
use mio::net::SocketAddr;
use rand::Fill as Randomize;
use memoffset::span_of;

View File

@@ -1,10 +1,4 @@
use std::{
fs::{self, write},
net::UdpSocket,
path::PathBuf,
process::Stdio,
time::Duration,
};
use std::{fs, net::UdpSocket, path::PathBuf, time::Duration};
use clap::Parser;
use rosenpass::{app_server::AppServerTestBuilder, cli::CliArgs};
@@ -58,7 +52,7 @@ fn setup_logging() {
buf,
"\x1b[1m{:?}\x1b[0m {}: {}",
std::thread::current().id(),
&ts_format[18..],
&ts_format[14..],
record.args()
)
});
@@ -156,7 +150,7 @@ fn check_exchange_under_normal() {
}
};
let listen_addr = format!("localhost:{port}");
let listen_addr = format!("127.0.0.1:{port}");
let mut server_cmd = std::process::Command::new(BIN);
server_cmd
@@ -229,7 +223,7 @@ fn check_exchange_under_dos() {
}
};
let listen_addr = format!("localhost:{port}");
let listen_addr = format!("127.0.0.1:{port}");
let mut server_cmd = std::process::Command::new(BIN);