Skip to content

Add support for other metrics/units#18

Draft
matheusd wants to merge 1 commit into
goptics:mainfrom
matheusd:other-metrics
Draft

Add support for other metrics/units#18
matheusd wants to merge 1 commit into
goptics:mainfrom
matheusd:other-metrics

Conversation

@matheusd
Copy link
Copy Markdown

@matheusd matheusd commented Oct 6, 2025

Initial work to support metrics other than the common ones. In particular, this adds support for the standard throughput metrics (MB/s) added by the SetBytes() call.

This is only a basic implementation, I can add the missing stuff later (tests, parametrization) if you think this is in the right direction and something desirable.

@fahimfaisaal fahimfaisaal marked this pull request as ready for review October 8, 2025 13:03
@fahimfaisaal
Copy link
Copy Markdown
Member

Hi @matheusd, Thanks for Initiative.

LGTM. You could move on.

@fahimfaisaal fahimfaisaal marked this pull request as draft October 8, 2025 14:55
@fahimfaisaal fahimfaisaal marked this pull request as ready for review November 24, 2025 13:35
@fahimfaisaal fahimfaisaal marked this pull request as draft November 24, 2025 13:41
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +92 to +96
benchStat = shared.Stat{
Type: "Throughput",
Value: float64(value.Value) / 1e6,
Unit: "MB/s",
NotPerOp: true,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prevent chart panic when throughput stats are missing

Adding the throughput branch here means only benchmarks that emit B/s (i.e., those calling SetBytes) get an extra Stat, while others in the same run still have the original length. GenerateHTMLCharts iterates stat indices from the first result across all results and blindly indexes r.Stats[statIndex]; if the first benchmark includes throughput but a later one does not, chart creation will panic or shift subsequent metrics under the wrong title. This shows up on a mixed benchmark file where the first test sets bytes per op and the next one doesn’t. Please normalize the stat slices before charting (e.g., pad missing entries or align by stat type) so mixed workloads don’t crash.

Useful? React with 👍 / 👎.

@fahimfaisaal fahimfaisaal force-pushed the main branch 2 times, most recently from 159daef to 7629bfa Compare May 23, 2026 16:36
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.

2 participants