diff --git a/attack.go b/attack.go index 3a076c6..69d7283 100644 --- a/attack.go +++ b/attack.go @@ -4,7 +4,7 @@ import ( "bytes" "flag" "fmt" - vegeta "github.com/tsenart/vegeta/lib" + vegeta "github.com/senaduka/vegeta/lib" "log" "net/http" "strings" @@ -64,7 +64,7 @@ func attack(rate uint64, duration time.Duration, targetsf, ordering, output stri } defer out.Close() - log.Printf("Vegeta is attacking %d targets in %s order for %s...\n", len(targets), ordering, duration) + log.Printf("Vegeta is attacking %d targets in %s order for %s with %d requests/sec...\n", len(targets), ordering, duration, rate) results := vegeta.Attack(targets, rate, duration) log.Println("Done!") log.Printf("Writing results to '%s'...", output) @@ -74,6 +74,8 @@ func attack(rate uint64, duration time.Duration, targetsf, ordering, output stri return nil } + + const ( errRatePrefix = "Rate: " errDurationPrefix = "Duration: " diff --git a/lib/results.go b/lib/results.go index 94e4e40..f294077 100644 --- a/lib/results.go +++ b/lib/results.go @@ -16,6 +16,7 @@ type Result struct { BytesOut uint64 BytesIn uint64 Error string + Rate uint64 } // Results is a slice of Result structs with encoding, diff --git a/main.go b/main.go index 7184bb2..41effae 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,7 @@ var usage = fmt.Sprintf( Commands: attack Hit the targets report Report the results + rapid Hit the targets with multiple rates Globals: -cpus=%d Number of CPUs to use @@ -34,6 +35,7 @@ func main() { commands := map[string]func([]string) command{ "attack": attackCmd, "report": reportCmd, + "rapid": rapidCmd, } args := flag.Args() diff --git a/release.sh b/release.sh index 6b367f4..851d267 100755 --- a/release.sh +++ b/release.sh @@ -1,7 +1,7 @@ #!/bin/sh for OS in "linux" "darwin"; do - for ARCH in "386" "amd64"; do + for ARCH in "amd64"; do GOOS=$OS CGO_ENABLED=0 GOARCH=$ARCH go build -o vegeta REV=$(git rev-parse HEAD) ARCHIVE=vegeta-$OS-$ARCH-${REV:0:7}.tar.gz