2015-02-09 21:26:40 +00:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class Vegeta < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "HTTP load testing tool and library"
|
2015-02-09 21:26:40 +00:00
|
|
|
homepage "https://github.com/tsenart/vegeta"
|
2015-05-23 20:54:50 +00:00
|
|
|
url "https://github.com/tsenart/vegeta/archive/v5.7.1.tar.gz"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "8bf49431f9eb1b36cd3f8b816f12a8e9e5b2b5b601223e45aae13d702bda9117"
|
2015-02-09 21:26:40 +00:00
|
|
|
|
2015-02-19 16:43:49 +00:00
|
|
|
bottle do
|
2015-02-20 15:38:23 +00:00
|
|
|
cellar :any
|
2015-05-23 22:07:36 +00:00
|
|
|
sha256 "ef0965454eb37a26a2113647d4214e14d38d8f3e89f26de2da2471972e8962a9" => :yosemite
|
|
|
|
sha256 "46b4b7560d65c47deb00bedc5b6f2e80549074bc0b9c0d639ca7cac1e83e22c3" => :mavericks
|
|
|
|
sha256 "8cfd06e0427cacb68bb65357fab9bf95375748b7b8c7a64fcb21076701b6ce5f" => :mountain_lion
|
2015-02-19 16:43:49 +00:00
|
|
|
end
|
|
|
|
|
2015-02-09 21:26:40 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
go_resource "github.com/bmizerany/perks" do
|
|
|
|
url "https://github.com/bmizerany/perks.git",
|
|
|
|
:revision => "6cb9d9d729303ee2628580d9aec5db968da3a607"
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
mkdir_p buildpath/"src/github.com/tsenart/"
|
|
|
|
ln_s buildpath, buildpath/"src/github.com/tsenart/vegeta"
|
|
|
|
ENV["GOPATH"] = buildpath
|
2015-04-16 16:57:39 +00:00
|
|
|
ENV["CGO_ENABLED"] = "0"
|
2015-02-09 21:26:40 +00:00
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
|
2015-05-23 20:54:50 +00:00
|
|
|
system "go", "build", "-ldflags", "-X main.Version v5.7.1", "-o", "vegeta"
|
2015-02-09 21:26:40 +00:00
|
|
|
bin.install "vegeta"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-04-16 16:57:39 +00:00
|
|
|
pipe_output("#{bin}/vegeta attack -duration=1s -rate=1 | #{bin}/vegeta report", "GET http://localhost/")
|
2015-02-09 21:26:40 +00:00
|
|
|
end
|
|
|
|
end
|