This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage: | |
// $ cargo build --bin vegeta --release | |
// $ ./target/release/vegeta -u http://localhost:8000/foo -r 5 -d 30 | |
// generates 5 requests per second, during 30 seconds, targeting to http://localhost:8000/foo | |
use std::time::{Duration, Instant}; | |
use tokio::sync::mpsc; | |
use histogram::Histogram; | |
use std::io::{self, Write}; | |
use anyhow::Result; | |
use tokio::sync::mpsc::Sender; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anyhow::Result; | |
use chrono::prelude::*; | |
use http::HeaderValue; | |
use std::net::IpAddr; | |
use std::{convert::Infallible, env, net::SocketAddr}; | |
use hyper::server::conn::AddrStream; | |
use hyper::service::{make_service_fn, service_fn}; | |
use hyper::{Body, Request, Response, Server, StatusCode}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"strings" | |
"fmt" | |
"log" | |
"net/http" | |
"io/ioutil" | |
"github.com/aws/aws-sdk-go/aws/session" |