Skip to content

Commit cb3b6f8

Browse files
committed
updated readme, pylintrc, plaintext sizes
1 parent 5ab94c6 commit cb3b6f8

19 files changed

+53
-326
lines changed

performance_tests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This project is licensed under the Apache-2.0 License.
66

77
## Overview
88

9-
Here are the keyrings / master key-providers that we plan to test:
9+
Here are the keyrings / master key-providers that we are testing:
1010

1111
1. KMS Keyring / KMS Master Key Provider
1212
2. Raw AES Keyring / AES Master Key Provider
@@ -20,7 +20,7 @@ For each keyring / master key-provider, we test the execution time and memory co
2020
2. Encrypt
2121
3. Decrypt
2222

23-
We demonstrate the usage of the performance tests through an [AWS KMS Keyring](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-kms-keyring.html). However, the procedure is the same for any keyring / master key-provider.
23+
We demonstrate the usage of the performance tests through an [AWS KMS Keyring](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-kms-keyring.html). However, the procedure is the same for any keyring / master key-provider, with slight change in the input arguments.
2424

2525
The results for the performance test will be available in the results folder in the performance_tests directory.
2626

performance_tests/consolidate_results.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
"""Script for consolidating results for execution times"""
44

55
import csv
6-
import sys
6+
import argparse
7+
import numpy as np
78

89

910
def calculate_statistics(_csv_file):
10-
"""Calculate min, max and average statistics for execution times in a CSV file."""
11+
"""Calculate min, max, average and p99 statistics for execution times in a CSV file."""
1112
with open(_csv_file, 'r', encoding='utf-8') as file:
1213
reader = csv.reader(file)
1314
data = [float(row[0]) for row in reader]
@@ -18,24 +19,26 @@ def calculate_statistics(_csv_file):
1819
_average = sum(data) / _total_entries
1920
_minimum = min(data)
2021
_maximum = max(data)
21-
return _total_entries, _average, _minimum, _maximum
22+
_perc_99 = np.percentile(data, 99)
23+
return _total_entries, _average, _minimum, _maximum, _perc_99
2224

2325
return None
2426

2527

2628
if __name__ == "__main__":
27-
if len(sys.argv) != 2:
28-
print("Usage: python consolidate_results.py <csv_file>")
29-
sys.exit(1)
29+
parser = argparse.ArgumentParser()
30+
parser.add_argument('csv_file',
31+
help='csv file containing the outputs of execution times for n_iter iterations')
32+
args = parser.parse_args()
3033

31-
csv_file = sys.argv[1]
32-
statistics = calculate_statistics(csv_file)
34+
statistics = calculate_statistics(args.csv_file)
3335
if statistics:
34-
total_entries, average, minimum, maximum = statistics
35-
print("CSV File:", csv_file)
36+
total_entries, average, minimum, maximum, perc_99 = statistics
37+
print("CSV File:", args.csv_file)
3638
print("Total Entries:", total_entries)
3739
print("Average:", average)
3840
print("Minimum:", minimum)
3941
print("Maximum:", maximum)
42+
print("99th percentile:", perc_99)
4043
else:
4144
print("No data found in the CSV file.")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
amazon-cryptographic-material-providers-test-vectors @ git+https://github.com/aws/aws-cryptographic-material-providers-library.git@lucmcdon/python-mpl#subdirectory=TestVectorsAwsCryptographicMaterialProviders/runtimes/python
1+
aws-cryptographic-material-providers @ git+https://github.com/aws/aws-cryptographic-material-providers-library.git@lucmcdon/python-mpl#subdirectory=AwsCryptographicMaterialProviders/runtimes/python

performance_tests/src/aws_encryption_sdk_performance_tests/keyrings/aws_kms_keyring.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from aws_cryptographic_materialproviders.mpl.config import MaterialProvidersConfig
99
from aws_cryptographic_materialproviders.mpl.models import CreateAwsKmsKeyringInput
1010
from aws_cryptographic_materialproviders.mpl.references import IKeyring
11-
from aws_encryption_sdk import CommitmentPolicy
1211

1312

1413
def create_keyring(
@@ -55,9 +54,7 @@ def encrypt_using_keyring(
5554
:param keyring: Keyring to use for encryption.
5655
:type keyring: IKeyring
5756
"""
58-
client = aws_encryption_sdk.EncryptionSDKClient(
59-
commitment_policy=CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT
60-
)
57+
client = aws_encryption_sdk.EncryptionSDKClient()
6158

6259
ciphertext_data, _ = client.encrypt(
6360
source=plaintext_data,
@@ -79,9 +76,7 @@ def decrypt_using_keyring(
7976
:param keyring: Keyring to use for decryption.
8077
:type keyring: IKeyring
8178
"""
82-
client = aws_encryption_sdk.EncryptionSDKClient(
83-
commitment_policy=CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT
84-
)
79+
client = aws_encryption_sdk.EncryptionSDKClient()
8580

8681
decrypted_plaintext_data, _ = client.decrypt(
8782
source=ciphertext_data,

performance_tests/src/aws_encryption_sdk_performance_tests/master_key_providers/aws_kms_key_provider.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""Performance tests for the AWS KMS master key provider."""
44

55
import aws_encryption_sdk
6-
from aws_encryption_sdk import CommitmentPolicy
76

87

98
def create_key_provider(
@@ -38,9 +37,7 @@ def encrypt_using_key_provider(
3837
:param key_provider: Master key provider to use for encryption.
3938
:type key_provider: aws_encryption_sdk.key_providers.base.MasterKeyProvider
4039
"""
41-
client = aws_encryption_sdk.EncryptionSDKClient(
42-
commitment_policy=CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT
43-
)
40+
client = aws_encryption_sdk.EncryptionSDKClient()
4441

4542
ciphertext_data, _ = client.encrypt(
4643
source=plaintext_data,
@@ -62,9 +59,7 @@ def decrypt_using_key_provider(
6259
:param key_provider: Master key provider to use for decryption.
6360
:type key_provider: aws_encryption_sdk.key_providers.base.MasterKeyProvider
6461
"""
65-
client = aws_encryption_sdk.EncryptionSDKClient(
66-
commitment_policy=CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT
67-
)
62+
client = aws_encryption_sdk.EncryptionSDKClient()
6863

6964
decrypted_plaintext_data, _ = client.decrypt(
7065
source=ciphertext_data,

performance_tests/src/aws_encryption_sdk_performance_tests/master_key_providers/pylintrc

Lines changed: 0 additions & 45 deletions
This file was deleted.

performance_tests/src/aws_encryption_sdk_performance_tests/utils/pylintrc

Lines changed: 0 additions & 45 deletions
This file was deleted.

performance_tests/src/pylintrc

Lines changed: 0 additions & 45 deletions
This file was deleted.

performance_tests/test/keyrings/pylintrc

Lines changed: 0 additions & 45 deletions
This file was deleted.

performance_tests/test/master_key_providers/pylintrc

Lines changed: 0 additions & 45 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)