55 lines
1.8 KiB
Ruby
55 lines
1.8 KiB
Ruby
class Siege < Formula
|
|
desc "HTTP regression testing and benchmarking utility"
|
|
homepage "https://www.joedog.org/siege-home/"
|
|
url "http://download.joedog.org/siege/siege-4.0.7.tar.gz"
|
|
sha256 "bfa75b3eaad372e7b89eee75d789cd6acbda34900a0c6e49030cf0f803b56df8"
|
|
license "GPL-3.0"
|
|
|
|
livecheck do
|
|
url "http://download.joedog.org/siege/?C=M&O=D"
|
|
regex(/href=.*?siege[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 "ccc545449c2a0bacb0054078faee630f23e4728d1bf137cba9c5d8aa82e02495" => :catalina
|
|
sha256 "0704038a2995eec4ffacbb3554230b2825ebb21c3c9c612baae24999a620e183" => :mojave
|
|
sha256 "d2793b5aee87ffe4c04fca2c807477c3bcc8c5979888d26db995e0e58bece246" => :high_sierra
|
|
end
|
|
|
|
depends_on "openssl@1.1"
|
|
|
|
def install
|
|
# To avoid unnecessary warning due to hardcoded path, create the folder first
|
|
(prefix/"etc").mkdir
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--prefix=#{prefix}",
|
|
"--mandir=#{man}",
|
|
"--localstatedir=#{var}",
|
|
"--with-ssl=#{Formula["openssl@1.1"].opt_prefix}",
|
|
"--with-zlib=#{MacOS.sdk_path_if_needed}/usr"
|
|
system "make", "install"
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
macOS has only 16K ports available that won't be released until socket
|
|
TIME_WAIT is passed. The default timeout for TIME_WAIT is 15 seconds.
|
|
Consider reducing in case of available port bottleneck.
|
|
|
|
You can check whether this is a problem with netstat:
|
|
|
|
# sysctl net.inet.tcp.msl
|
|
net.inet.tcp.msl: 15000
|
|
|
|
# sudo sysctl -w net.inet.tcp.msl=1000
|
|
net.inet.tcp.msl: 15000 -> 1000
|
|
|
|
Run siege.config to create the ~/.siegerc config file.
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/siege", "--concurrent=1", "--reps=1", "https://www.google.com/"
|
|
end
|
|
end
|