<commit_before>class Ghz < Formula
  desc "Simple gRPC benchmarking and load testing tool"
  homepage "https://ghz.sh"
  url "https://github.com/bojand/ghz/archive/v0.54.1.tar.gz"
  sha256 "b1f56a71abd018141f757e12ffc27e6c001acd4e608ae8b17595bce46935e05d"

  bottle do
    cellar :any_skip_relocation
    sha256 "9f7cab0c03480a956b6764c5fa25fd213cbea66c23dd67b85322f99ad1bf8a1a" => :catalina
    sha256 "78154dab1359300c271262730234e69cb2f5e80a93923b37e98e60d61ff12b81" => :mojave
    sha256 "a0d6cd5c94bf3b0322c891f211737989caba73779b4c3ba489b94e62c20fa3a4" => :high_sierra
  end

  depends_on "go" => :build

  def install
    system "go", "build",
      "-ldflags", "-s -w -X main.version=#{version}",
      *std_go_args,
      "cmd/ghz/main.go"
    prefix.install_metafiles
  end

  test do
    assert_match version.to_s, shell_output("#{bin}/ghz -v 2>&1")
    (testpath/"config.toml").write <<~EOS
      proto = "greeter.proto"
      call = "helloworld.Greeter.SayHello"
      host = "0.0.0.0:50051"
      insecure = true
      [data]<commit_msg>ghz 0.55.0<commit_after>class Ghz < Formula
  desc "Simple gRPC benchmarking and load testing tool"
  homepage "https://ghz.sh"
  url "https://github.com/bojand/ghz/archive/v0.55.0.tar.gz"
  sha256 "d968e7841ec5c06bed2ab297308defa8ff268acd1ecdc7c003aebfc593f29d5d"

  bottle do
    cellar :any_skip_relocation
    sha256 "9f7cab0c03480a956b6764c5fa25fd213cbea66c23dd67b85322f99ad1bf8a1a" => :catalina
    sha256 "78154dab1359300c271262730234e69cb2f5e80a93923b37e98e60d61ff12b81" => :mojave
    sha256 "a0d6cd5c94bf3b0322c891f211737989caba73779b4c3ba489b94e62c20fa3a4" => :high_sierra
  end

  depends_on "go" => :build

  def install
    system "go", "build",
      "-ldflags", "-s -w -X main.version=#{version}",
      *std_go_args,
      "cmd/ghz/main.go"
    prefix.install_metafiles
  end

  test do
    assert_match version.to_s, shell_output("#{bin}/ghz -v 2>&1")
    (testpath/"config.toml").write <<~EOS
      proto = "greeter.proto"
      call = "helloworld.Greeter.SayHello"
      host = "0.0.0.0:50051"
      insecure = true
      [data]
{'fraction_non_alphanumeric': 0.11529299666507861, 'fraction_numerical': 0.17960933777989518, 'mean_word_length': 3.883720930232558, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3895363', 'n_tokens_mistral': 1109, 'n_tokens_neox': 916, 'n_words': 132}