Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 1.03 KB

README.md

File metadata and controls

28 lines (21 loc) · 1.03 KB

Profiler

Profiler is an asynchronous web server profiling library that supports concurrent requests.

Benchmarks the following metrics when talking to a web server:

  • DNS resolution (Uses tokio::net::lookup_host)
  • TCP connection (Uses tokio::net::TcpStream)
  • TLS connection (Uses tokio_native_tls::TlsConnector)
  • First byte received (Tracks bytes received on tokio_native_tls::TlsStream)
  • Total response time (Sums all elapsed times)

Usage Example

use profiler;

#[tokio::main]
async fn main() {
    let domain = "google.com";
    let concurrency = 3;

    match profiler::benchmark(&domain, concurrency).await {
        Ok(benchmarks) => println!("{:?}", benchmarks),
        Err(e) => panic!("Failed to profile webserver {}", e),
    }
}