Skip to content
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

Support negative threshold for bigger-is-better in other tools #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aherlihy
Copy link

Hi, I'd like to request support for using existing tools with a bigger-is-better ratio for alerts. My use case is for JMH which has both a throughput and an execution time mode, I'd like to be able to specify if bigger or smaller is better without dealing with a custom benchmark.

The idea in this PR is that by specifying a negative threshold, you would be indicating that a decrease is something to alert on, but otherwise operates the same. Ideally, we would be able to specify bigger or smaller is better on a per-benchmark case, but that looks like it would require more thought, so in the meantime I thought I'd suggest a quick fix so we can use it asap :)

Copy link

@matthargett matthargett left a comment

Choose a reason for hiding this comment

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

Thanks for adding tests!

@@ -210,7 +210,7 @@ function validateAlertThreshold(alertThreshold: number | null, failThreshold: nu
if (alertThreshold === null) {
throw new Error("'alert-threshold' input must not be empty");
}
if (failThreshold && alertThreshold > failThreshold) {
if (failThreshold && Math.abs(alertThreshold) > Math.abs(failThreshold)) {
Copy link
Member

@ningziwen ningziwen May 10, 2023

Choose a reason for hiding this comment

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

Is this a breaking change as it adds another scenario that can alert?

The breaking change may be prevented if we add an additional configrable field to toggle this. (as you stated in PR description)

WDYT? How strict are we treating breaking change? @ktrz

Copy link
Member

Choose a reason for hiding this comment

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

I'm not super fond of the current solution. I would much rather modify the biggerIsBetter function to determine the value based on the units as well.

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.

4 participants