Skip to content

Commit edd6e20

Browse files
committed
MAGETWO-33860: Improve PAT build experience
- threshold for improvement/degradation parameter
1 parent e810f35 commit edd6e20

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dev/tests/performance/compare_reports.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
. ' -b - branch report file' . PHP_EOL
1515
. ' -o - output xml file' . PHP_EOL
1616
. ' -p - percent of measurements, that will be skipped (default = 15)' . PHP_EOL
17-
. ' -t - plain text report file (optional)' . PHP_EOL;
17+
. ' -t - plain text report file (optional)' . PHP_EOL
18+
. ' -d - threshold for improvement/degradation for plain-text report (default = 1.5)' . PHP_EOL;
1819

19-
$args = getopt('m:b:o:p:t:');
20+
$args = getopt('m:b:o:p:t:d:');
2021
if (empty($args)) {
2122
echo $usageMessage;
2223
exit(0);
@@ -27,6 +28,7 @@
2728
$outputFile = $args['o'];
2829
$plainReportFile = isset($args['t']) ? $args['t'] : false;
2930
$skipMeasurementsPercent = isset($args['p']) && $args['p'] != '' ? min(100, max(0, $args['p'])) : 15;
31+
$threshold = isset($args['d']) ? $args['d'] : 1.5;
3032

3133
try {
3234
$mainlineResults = readResponseTimeReport($mainlineFile);
@@ -71,7 +73,7 @@
7173
) :
7274
'',
7375
$success ?
74-
($deviation < -1.5 ? 'improvement' : ($deviation > 1.5 ? 'DEGRADATION' : 'ok')) :
76+
($deviation < -$threshold ? 'improvement' : ($deviation > $threshold ? 'DEGRADATION' : 'ok')) :
7577
'FAILED'
7678
];
7779
}

0 commit comments

Comments
 (0)