{"id":29654893,"url":"https://github.com/learnitall/gobench","last_synced_at":"2025-07-22T07:36:01.917Z","repository":{"id":57748376,"uuid":"454615384","full_name":"learnitall/gobench","owner":"learnitall","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-15T01:04:07.000Z","size":252,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-20T03:00:18.524Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/learnitall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-02T02:03:28.000Z","updated_at":"2022-04-01T14:47:26.000Z","dependencies_parsed_at":"2022-09-11T18:50:18.301Z","dependency_job_id":null,"html_url":"https://github.com/learnitall/gobench","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/learnitall/gobench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learnitall%2Fgobench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learnitall%2Fgobench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learnitall%2Fgobench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learnitall%2Fgobench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/learnitall","download_url":"https://codeload.github.com/learnitall/gobench/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/learnitall%2Fgobench/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266448828,"owners_count":23930308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-22T07:36:01.354Z","updated_at":"2025-07-22T07:36:01.902Z","avatar_url":"https://github.com/learnitall.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gobench\n\ngobench is a benchmark wrapper utility written in go, based off of [benchmark-wrapper](https://github.com/cloud-bulldozer/benchmark-wrapper).\n\nIt helps automate the process of running a benchmark, parsing its results, and exporting those results.\n\n## Installing\n\ngobench can be installed just like any other published go module, using the go CLI. Right now, gobench is under development and still refining its structure, therefore we are still publishing under the `v0` tag:\n\n`$ go install github.com/learnitall/gobench@v0`\n\ngobench can also be built and used through the included `Containerfile`s and `Makefile`, which is based on [podman](https://github.com/containers/podman). The main advantage of this route is that all benchmark-specific dependencies are packaged within the benchmark's `Containerfile`, requiring less setup on your end. For instance, to build gobench's base image (which all benchmark images inherit from), and build the `uperf` image, just run the following from the project root:\n\n`$ make uperf`\n\nNote that the base image contains a lot of cached content and therefore is a relatively large size, `\u003e1.5GB`. This was purposeful, as it allows for very speedy and small benchmark image builds, which are `\u003c100MB`.\n\nBy default, all images built using the makefile will be tagged with `latest` and a manifest will be created to support multi-arch builds. To change the default tag, set the `TAG` environment variable:\n\n`$ TAG=mytag make uperf`\n\nFor more information, please take a look at the [Makefile].\n\nWhen running and building from source, please note that `gobench` uses benchmark-specific build tags to optimize build-time when only using a subset of available benchmarks. For instance, if you'd like to test uperf locally, you'd need to add the `uperf` and `uperf_test` build flags to go:\n\n`$ cd benchmarks/uperf \u0026\u0026 go test -tags uperf,uperf_test .`\n\n## High-Level Structure\n\ngobench is built to run benchmarks, parse the output, and export the results. The main flow of execution is as follows:\n\n1. Perform universal setup tasks, such as parsing flags and arguments and setting the log level.\n2. Instantiate exporter objects based on given configuration.\n3. Setup each exporter and perform a healthcheck to ensure they are all ready.\n4. Kick off the benchmark.\n5. If successful, grab the stdout and parse it into marshal-able object(s).\n6. Marshal the resulting objects and send the bytes to each configured exporter.\n7. Cleanup the benchmark.\n8. Cleanup each exporter.\n9. Fin.\n\nThe role that a user plays in all of this is telling gobench what to do. To explore gobench's universal options and benchmark-specific options, use the `--help` flag.\n\nFrom a developer's perspective, gobench as a module is structured as follows:\n\n* Root: `Containerfile`s, `Makefile`, `main.go`\n* `mappings/`: ElasticSearch index mappings for each benchmark's output.\n* `exporters/`: Definition and implementation of each available exporter.\n* `define/`: Definition of high-level structs used within gobench.\n* `cmd/`: [Cobra](https://github.com/spf13/cobra) based, [viper](https://github.com/spf13/viper) enabled CLI.\n* `benchmarks/**`: Definition and implementation of each benchmark supported by gobench.\n\n\n## Getting Started\n\nTo see a list of currently supported benchmarks, run the following and check the list of available commands:\n\n`$ gobench run --help`\n\nLet's run through an example.\n\nLet's say I want to run `uperf` using the default [iperf.xml](https://raw.githubusercontent.com/uperf/uperf/master/workloads/iperf.xml) workload, in a basic localhost-localhost network performance test. We'll first start by cloning gobench and building our uperf container image:\n\n```bash\n$ git clone https://github.com/learnitall/gobench\n$ cd gobench\n$ make uperf\n```\n\nNow let's create a quick script to run inside our container and name it `test.sh`:\n\n```bash\n#!/bin/bash\n# test.sh\n\n# start a uperf worker\nuperf -s \u003e /dev/null 2\u003e\u00261 \u0026\n# download the workload\ncurl -s -LO https://raw.githubusercontent.com/uperf/uperf/master/workloads/iperf.xml\n\n# set uperf env variables\nexport h=localhost\nexport proto=tcp\nexport nthr=3\n\n# run the benchmark\n# -p: print results in json\n# -q: silence all log output\n# --: start uperf args\n# iperf.xml: our target workload\n# -R: ask uperf to give results in raw format\ngobench run uperf \\\n    -p \\\n    -q \\\n    -- \\\n    iperf.xml \\\n   -R\n```\n\nFinally, we can run our test benchmark and explore with jq:\n\n```bash\npodman run --rm -it -v ./test.sh:/opt/test.sh:Z gobench:uperf-latest /opt/test.sh \u003e out.json\ncat out.json | jq\n```\n\nIf you'd like to experiment with exporting results to a EK stack, the `Makefile` comes included with recipes for setting up a local stack with podman. Check out the `local-es`, `local-kb` and `local-cleanup` recipes.\n\n## Development Values\n\nThese are the values that gobench strives to maintain during development:\n\n1. Easy to use.\n2. Readable code that's easy to modify to, contribute to and debug.\n3. Modular nature, enabling support for any benchmark with any export format.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flearnitall%2Fgobench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flearnitall%2Fgobench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flearnitall%2Fgobench/lists"}