Skip to content

feat: parse go bench results using go test #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

not-matthias
Copy link
Member

@not-matthias not-matthias commented Jul 24, 2025

Changes in this PR:

  • Capture stdout and then parse it later on
  • Parse go test -json output
  • Create results/{pid}.json

Can be used like this (users have to specify the benchtime and count fow now):

codspeed run -- go test -json -bench=. -benchtime=200ms -count=10 ./...

Example run: https://staging.codspeed.io/AvalancheHQ/fuego/runs/6882013bc8c28e8027e3f46a

@not-matthias not-matthias force-pushed the cod-1193-parse-go-bench-results-using-go-test branch from 95dae9c to 1a62b5a Compare July 24, 2025 08:51
@not-matthias not-matthias requested a review from Copilot July 24, 2025 08:54
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for parsing Go benchmark results by capturing stdout from go test -json commands and converting the output to walltime benchmark format. The implementation includes JSON parsing of Go test output, statistical analysis of benchmark data, and creation of results files.

  • Captures and parses go test -json output to extract benchmark measurements
  • Adds statistical analysis and outlier detection for benchmark timing data
  • Creates structured JSON results files in results/{pid}.json format

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/run/runner/wall_time/mod.rs Adds golang module to wall_time runner
src/run/runner/wall_time/perf/mod.rs Updates to handle new return type from command runner
src/run/runner/wall_time/golang/mod.rs Main entry point for Go benchmark result collection
src/run/runner/wall_time/golang/parser.rs Parses Go test JSON output and extracts benchmark data
src/run/runner/wall_time/golang/walltime_results.rs Statistical analysis and result formatting for benchmarks
src/run/runner/wall_time/executor.rs Integrates Go test parsing into wall time executor
src/run/runner/helpers/run_command_with_log_pipe.rs Adds stdout capture capability to command runner
Cargo.toml Adds statrs dependency for statistical calculations
.gitattributes Configures LFS tracking for test data files

@not-matthias not-matthias force-pushed the cod-1193-parse-go-bench-results-using-go-test branch from 1a62b5a to ac4c59d Compare July 24, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant