Skip to content

Commit 1614a5f

Browse files
committed
perf-test: New option --compare-to to include past results in tables
This simplifies performance comparison.
1 parent 03aa2b8 commit 1614a5f

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

scripts/perf-test/ec2.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Parameters:
4141
WitnessCheck:
4242
Type: String
4343

44+
CompareTo:
45+
Type: String
46+
4447
Conditions:
4548
UseSpot: !Not [!Equals [!Ref MaxPrice, ""]]
4649

@@ -68,6 +71,10 @@ Resources:
6871
- "s3:GetObject"
6972
Effect: Allow
7073
Resource: !Join ["/", [!Sub "arn:aws:s3:::${S3Bucket}", "*"]]
74+
- Action:
75+
- "s3:ListBucket"
76+
Effect: Allow
77+
Resource: !Sub "arn:aws:s3:::${S3Bucket}"
7178
- Action:
7279
- "sns:Publish"
7380
Effect: Allow
@@ -169,6 +176,7 @@ Resources:
169176
sed -i 's#:S3BUCKET:#${S3Bucket}#g' /root/run-on-ec2.sh
170177
sed -i 's#:PERFTESTID:#${PerfTestId}#g' /root/run-on-ec2.sh
171178
sed -i 's#:INSTANCETYPE:#${InstanceType}#g' /root/run-on-ec2.sh
179+
sed -i 's#:COMPARETO:#${CompareTo}#g' /root/run-on-ec2.sh
172180
. /root/run-on-ec2.sh
173181

174182
AutoScalingGroup:

scripts/perf-test/perf_test.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def parse_args():
7272
help='Non-default CodeBuild template to use')
7373
parser.add_argument('-W', '--witness-check', action='store_true',
7474
help='Run witness checks after benchmarking')
75+
parser.add_argument('-C', '--compare-to', default=[], action='append',
76+
help='Include past results in tables [may repeat]')
7577

7678
args = parser.parse_args()
7779

@@ -517,7 +519,7 @@ def seed_queue(session, region, queue, task_set):
517519
def run_perf_test(
518520
session, mode, region, az, ami, instance_type, sqs_arn, sqs_url,
519521
parallel, snapshot_id, instance_terminated_arn, bucket_name,
520-
perf_test_id, price, ssh_key_name, witness_check):
522+
perf_test_id, price, ssh_key_name, witness_check, compare_to):
521523
# create an EC2 instance and trigger benchmarking
522524
logger = logging.getLogger('perf_test')
523525

@@ -589,6 +591,10 @@ def run_perf_test(
589591
{
590592
'ParameterKey': 'WitnessCheck',
591593
'ParameterValue': str(witness_check)
594+
},
595+
{
596+
'ParameterKey': 'CompareTo',
597+
'ParameterValue': ':'.join(compare_to)
592598
}
593599
],
594600
Capabilities=['CAPABILITY_NAMED_IAM'])
@@ -685,7 +691,7 @@ def main():
685691
session, args.mode, region, az, ami, args.instance_type,
686692
sqs_arn, sqs_url, args.parallel, snapshot_id,
687693
instance_terminated_arn, bucket_name, perf_test_id, price,
688-
args.ssh_key_name, args.witness_check)
694+
args.ssh_key_name, args.witness_check, args.compare_to)
689695

690696
return 0
691697

scripts/perf-test/run-on-ec2.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,21 @@ do
201201
cd ..
202202
done
203203

204+
compare_to=""
204205
if [ x:WITNESSCHECK: = xTrue ]
205206
then
206-
../benchexec/bin/table-generator logs-$t/*xml.bz2 *-logs-$t/*.xml.bz2 -o logs-$t/
207-
else
208-
../benchexec/bin/table-generator logs-$t/*xml.bz2 -o logs-$t/
207+
compare_to="*-logs-$t/*.xml.bz2"
209208
fi
209+
for c in $(echo :COMPARETO: | sed 's/:/ /g')
210+
do
211+
if aws s3 ls s3://:S3BUCKET:/$c/$cfg/logs-$t/
212+
then
213+
aws s3 sync s3://:S3BUCKET:/$c/$cfg/logs-$t logs-$t-$c
214+
compare_to="$compare_to logs-$t-$c/*.xml.bz2"
215+
fi
216+
done
217+
218+
../benchexec/bin/table-generator logs-$t/*xml.bz2 $compare_to -o logs-$t/
210219
aws s3 cp logs-$t s3://:S3BUCKET:/:PERFTESTID:/$cfg/logs-$t/ --recursive
211220
for wc in *-witnesses.xml
212221
do

0 commit comments

Comments
 (0)