def get_throughput()

in src/neper_healthcheck/neper_runner.py [0:0]


def get_throughput(log_file: str, local: bool) -> int:
  """Get local/remote throughput number from a log file."""

  with open(log_file, "r") as f:
    log_output = f.read()

    remote_throughput_match = re.search(r"remote_throughput=(\d+)", log_output)
    local_throughput_match = re.search(r"local_throughput=(\d+)", log_output)

    if local and local_throughput_match:
      local_throughput = int(local_throughput_match.group(1))
      return local_throughput
    if not local and remote_throughput_match:
      remote_throughput = int(remote_throughput_match.group(1))
      return remote_throughput

    return -1