Skip to content

Commit

Permalink
-1 as str not int
Browse files Browse the repository at this point in the history
  • Loading branch information
DawidNiezgodka committed Oct 18, 2023
1 parent 7a7341d commit 76bcc05
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions benchmark_results/curr.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
"results": [
{
"unit": "ms",
"value": 701,
"value": 100,
"name": "latency"
},
{
"unit": "op/s",
"value": 123,
"value": 100,
"name": "metric2"
},
{
"unit": "%",
"value": 456,
"value": 100,
"name": "metric3"
}
]
Expand Down
10 changes: 5 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ module.exports.createCommentBodyForComparisonWithPrevBench = function (

if (prev) {
if (comparisonMode === 'bigger') {
if (comparisonMargin === -1) {
if (comparisonMargin === '-1') {
currentBetter = currentMetric.value > prev.value
} else {
const lowerLimit = prev.value * (1 + comparisonMargin / 100)
currentBetter = currentMetric.value >= lowerLimit
}
} else if (comparisonMode === 'smaller') {
if (comparisonMargin === -1) {
if (comparisonMargin === '-1') {
console.log('Comparing smaller with margin -1')
currentBetter = currentMetric.value < prev.value
console.log('Current better: ' + currentBetter)
Expand Down Expand Up @@ -270,7 +270,7 @@ module.exports.createCommentBodyForComparisonWithThreshold = function (

if (comparisonMode === 'bigger') {
// If comparisonMargin is -1, we look for a strictly bigger value
if (comparisonMargin === -1) {
if (comparisonMargin === '-1') {
meetsThreshold = currentMetric.value > currentThreshold
}
// otherwise, we look for a value that is at least comparisonMargin% bigger
Expand All @@ -279,8 +279,8 @@ module.exports.createCommentBodyForComparisonWithThreshold = function (
meetsThreshold = currentMetric.value >= lowerLimit
}
} else if (comparisonMode === 'smaller') {
// If comparisonMargin is -1, we look for a strictly smaller value
if (comparisonMargin === -1) {
// If comparisonMargin is "-1", we look for a strictly smaller value
if (comparisonMargin === '-1') {
meetsThreshold = currentMetric.value < currentThreshold
}
// otherwise, we look for a value that is at least comparisonMargin% smaller
Expand Down

1 comment on commit 76bcc05

@DawidNiezgodka
Copy link
Owner Author

Choose a reason for hiding this comment

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

Benchmark

Benchmark information

Current Benchmark Previous Benchmark
Execution time: 138 m Execution time: 138 m
Parametrization: Parametrization:
- ack: 1 - ack: 1
- read-in-ram: true - read-in-ram: true
Other Info: kafka, v2.3 Other Info: kafka, v2.3

Results

Metric name Current: 76bcc05 Previous: 7a7341d Condition Result
latency 100 ms 701 ms smaller 🟢
metric2 100 op/s 123 op/s bigger 🔴
metric3 100 % 456 % range 🔴

Please sign in to comment.