Skip to content

Commit aee2f33

Browse files
[Storage] Update perf test arg parsing to allow for SDK defaults and add max_get_size (#43672)
1 parent 96e2089 commit aee2f33

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

sdk/storage/azure-storage-blob/tests/perfstress_tests/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ These options are available for all perf tests:
6161
The options are available for all Blob perf tests:
6262
- `--size=10240` Size in bytes of data to be transferred in upload or download tests. Default is 10240.
6363
- `--max-concurrency=1` Number of threads to concurrently upload/download a single operation using the SDK API parameter. Default is 1.
64-
- `--max-put-size` Maximum size of data uploading in single HTTP PUT. Default is 64\*1024\*1024.
65-
- `--max-block-size` Maximum size of data in a block within a blob. Defaults to 4\*1024\*1024.
66-
- `--buffer-threshold` Minimum block size to prevent full block buffering. Defaults to 4\*1024\*1024+1.
64+
- `--max-put-size` Maximum size of data uploading in single HTTP PUT.
65+
- `--max-block-size` Maximum size of data in a block within a blob.
66+
- `--max-get-size` Initial chunk size of a Blob download.
67+
- `--buffer-threshold` Minimum block size to prevent full block buffering.
6768
- `--client-encryption` The version of client-side encryption to use. Leave out for no encryption.
6869

6970
#### List Blobs command line options

sdk/storage/azure-storage-blob/tests/perfstress_tests/_test_base.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ def __init__(self, arguments):
2323
super().__init__(arguments)
2424
if self.args.test_proxies:
2525
self._client_kwargs['_additional_pipeline_policies'] = self._client_kwargs['per_retry_policies']
26-
self._client_kwargs['max_single_put_size'] = self.args.max_put_size
27-
self._client_kwargs['max_block_size'] = self.args.max_block_size
28-
self._client_kwargs['min_large_block_upload_threshold'] = self.args.buffer_threshold
26+
if self.args.max_put_size is not None:
27+
self._client_kwargs['max_single_put_size'] = self.args.max_put_size
28+
if self.args.max_block_size is not None:
29+
self._client_kwargs['max_block_size'] = self.args.max_block_size
30+
if self.args.max_get_size is not None:
31+
self._client_kwargs['max_single_get_size'] = self.args.max_get_size
32+
if self.args.buffer_threshold is not None:
33+
self._client_kwargs['min_large_block_upload_threshold'] = self.args.buffer_threshold
2934
if self.args.client_encryption:
3035
self.key_encryption_key = KeyWrapper()
3136
self._client_kwargs['require_encryption'] = True
@@ -58,9 +63,10 @@ async def close(self):
5863
@staticmethod
5964
def add_arguments(parser):
6065
super(_ServiceTest, _ServiceTest).add_arguments(parser)
61-
parser.add_argument('--max-put-size', nargs='?', type=int, help='Maximum size of data uploading in single HTTP PUT. Defaults to 64*1024*1024', default=64*1024*1024)
62-
parser.add_argument('--max-block-size', nargs='?', type=int, help='Maximum size of data in a block within a blob. Defaults to 4*1024*1024', default=4*1024*1024)
63-
parser.add_argument('--buffer-threshold', nargs='?', type=int, help='Minimum block size to prevent full block buffering. Defaults to 4*1024*1024+1', default=4*1024*1024+1)
66+
parser.add_argument('--max-put-size', nargs='?', type=int, help='Maximum size of data uploading in single HTTP PUT. Defaults to SDK default.', default=None)
67+
parser.add_argument('--max-block-size', nargs='?', type=int, help='Maximum size of data in a block within a blob. Defaults to SDK default.', default=None)
68+
parser.add_argument('--max-get-size', nargs='?', type=int, help='Initial chunk size of a Blob download. Defaults to SDK default.', default=None)
69+
parser.add_argument('--buffer-threshold', nargs='?', type=int, help='Minimum block size to prevent full block buffering. Defaults to SDK default.', default=None)
6470
parser.add_argument('--client-encryption', nargs='?', type=str, help='The version of client-side encryption to use. Leave out for no encryption.', default=None)
6571
parser.add_argument('--max-concurrency', nargs='?', type=int, help='Maximum number of concurrent threads used for data transfer. Defaults to 1', default=1)
6672
parser.add_argument('-s', '--size', nargs='?', type=int, help='Size of data to transfer. Default is 10240.', default=10240)

sdk/storage/azure-storage-file-share/tests/perfstress_tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ These options are available for all perf tests:
4949
The options are available for all SB perf tests:
5050
- `--size=100` Size in bytes of data to be transferred in upload or download tests. Default is 10240.
5151
- `--max-concurrency=1` Number of threads to concurrently upload/download a single operation using the SDK API parameter. Default is 1.
52-
- `--max-range-size`Maximum size of data uploading in single HTTP PUT. Default is 4*1024*1024.
52+
- `--max-range-size`Maximum size of data uploading in single HTTP PUT.
5353

5454
### T2 Tests
5555
The tests currently written for the T2 SDK:

sdk/storage/azure-storage-file-share/tests/perfstress_tests/_test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self, arguments):
2020
super().__init__(arguments)
2121
connection_string = self.get_from_env("AZURE_STORAGE_CONNECTION_STRING")
2222
kwargs = {}
23-
if self.args.max_range_size:
23+
if self.args.max_range_size is not None:
2424
kwargs['max_range_size'] = self.args.max_range_size
2525
if not _ServiceTest.service_client or self.args.no_client_share:
2626
_ServiceTest.service_client = SyncShareServiceClient.from_connection_string(conn_str=connection_string, **kwargs)
@@ -35,7 +35,7 @@ async def close(self):
3535
@staticmethod
3636
def add_arguments(parser):
3737
super(_ServiceTest, _ServiceTest).add_arguments(parser)
38-
parser.add_argument('-r', '--max-range-size', nargs='?', type=int, help='Maximum size of data uploading in single HTTP PUT. Defaults to 4*1024*1024', default=4*1024*1024)
38+
parser.add_argument('-r', '--max-range-size', nargs='?', type=int, help='Maximum size of data uploading in single HTTP PUT. Defaults to SDK default.', default=None)
3939
parser.add_argument('-c', '--max-concurrency', nargs='?', type=int, help='Maximum number of concurrent threads used for data transfer. Defaults to 1', default=1)
4040
parser.add_argument('-s', '--size', nargs='?', type=int, help='Size of data to transfer. Default is 10240.', default=10240)
4141
parser.add_argument('--no-client-share', action='store_true', help='Create one ServiceClient per test instance. Default is to share a single ServiceClient.', default=False)

0 commit comments

Comments
 (0)