Skip to content

Latest commit

 

History

History

profiler

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

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),
    }
}