diff --git a/awscli/botocore/session.py b/awscli/botocore/session.py index 5439c7f056bc..310f84de6e80 100644 --- a/awscli/botocore/session.py +++ b/awscli/botocore/session.py @@ -866,6 +866,7 @@ def create_client( :return: A botocore client instance """ + self.emit('before-create-client') default_client_config = self.get_default_client_config() # If a config is provided and a default config is set, then # use the config resulting from merging the two. @@ -960,6 +961,7 @@ def create_client( monitor = self._get_internal_component('monitor') if monitor is not None: monitor.register(client.meta.events) + self.emit('after-create-client') return client def _resolve_region_name(self, region_name, config): diff --git a/awscli/clidriver.py b/awscli/clidriver.py index 643331c50d46..206925cf6877 100644 --- a/awscli/clidriver.py +++ b/awscli/clidriver.py @@ -111,13 +111,13 @@ def main(): return AWSCLIEntryPoint().main(sys.argv[1:]) -def create_clidriver(args=None): +def create_clidriver(args=None, event_hooks=None): debug = None if args is not None: parser = FirstPassGlobalArgParser() args, _ = parser.parse_known_args(args) debug = args.debug - session = botocore.session.Session() + session = botocore.session.Session(event_hooks=event_hooks) _set_user_agent_for_session(session) load_plugins( session.full_config.get('plugins', {}), diff --git a/awscli/plugin.py b/awscli/plugin.py index 46a26a4fc1a7..7f9dc2472037 100644 --- a/awscli/plugin.py +++ b/awscli/plugin.py @@ -45,7 +45,9 @@ def load_plugins(plugin_mapping, event_hooks=None, include_builtins=True): if event_hooks is None: event_hooks = HierarchicalEmitter() if include_builtins: + event_hooks.emit('before-load-plugins') _load_plugins(BUILTIN_PLUGINS, event_hooks) + event_hooks.emit('after-load-plugins') plugin_path = plugin_mapping.pop(CLI_LEGACY_PLUGIN_PATH, None) if plugin_path is not None: _add_plugin_path_to_sys_path(plugin_path) diff --git a/scripts/performance/benchmark_utils.py b/scripts/performance/benchmark_utils.py index 06ec0218c416..3749f6e7e3fc 100644 --- a/scripts/performance/benchmark_utils.py +++ b/scripts/performance/benchmark_utils.py @@ -7,7 +7,6 @@ import psutil -from awscli.clidriver import AWSCLIEntryPoint, create_clidriver from scripts.performance import BaseBenchmarkSuite from scripts.performance.simple_stubbed_tests import ( JSONStubbedBenchmarkSuite, @@ -169,6 +168,21 @@ def _finalize_processed_data_for_file(self, samples, worker_results): worker_results['first_client_invocation_time'] - worker_results['start_time'], ), + 'plugins.load.time': Metric( + 'Total time spent loading all built-in plugins.', + 'Seconds', + worker_results['load_plugins_time'], + ), + 'imports.static.time': Metric( + 'Total time spent on static Python imports.', + 'Seconds', + worker_results['static_imports_time'], + ), + 'client.creation.time': Metric( + 'Total time spent creating a botocore client.', + 'Seconds', + worker_results['create-client-time'], + ), } # reset data state self._samples.clear() @@ -264,21 +278,72 @@ def _run_command_with_metric_hooks(self, cmd, out_file): Runs a CLI command and logs CLI-specific metrics to a file. """ first_client_invocation_time = None + create_client_start_time = None + create_client_end_time = None + plugin_import_start_time = None + plugin_import_end_time = None start_time = time.time() - driver = create_clidriver() - event_emitter = driver.session.get_component('event_emitter') + + before_imports = start_time + # We import from awscli lazily to ensure import time is measured in + # total runtime. + from awscli.botocore.hooks import HierarchicalEmitter + from awscli.clidriver import AWSCLIEntryPoint, create_clidriver + after_imports = time.time() def _log_invocation_time(params, request_signer, model, **kwargs): nonlocal first_client_invocation_time if first_client_invocation_time is None: first_client_invocation_time = time.time() - event_emitter.register_last( + def _log_create_client_start(**kwargs): + nonlocal create_client_start_time + if create_client_start_time is None: + create_client_start_time = time.time() + + def _log_create_client_end(**kwargs): + nonlocal create_client_end_time + if create_client_end_time is None: + create_client_end_time = time.time() + + def _log_import_plugins_start(**kwargs): + nonlocal plugin_import_start_time + if plugin_import_start_time is None: + plugin_import_start_time = time.time() + + def _log_import_plugins_end(**kwargs): + nonlocal plugin_import_end_time + if plugin_import_end_time is None: + plugin_import_end_time = time.time() + + event_hooks = HierarchicalEmitter() + event_hooks.register_last( 'before-call', _log_invocation_time, 'benchmarks.log-invocation-time', ) + event_hooks.register_last( + 'before-create-client', + _log_create_client_start, + 'benchmarks.log-before-create-client', + ) + event_hooks.register_last( + 'after-create-client', + _log_create_client_end, + 'benchmarks.log-after-create-client', + ) + event_hooks.register_last( + 'before-load-plugins', + _log_import_plugins_start, + 'benchmarks.log-before-load-plugins', + ) + event_hooks.register_last( + 'after-load-plugins', + _log_import_plugins_end, + 'benchmarks.log-after-load-plugins', + ) + driver = create_clidriver(event_hooks=event_hooks) rc = AWSCLIEntryPoint(driver).main(cmd) end_time = time.time() @@ -291,6 +356,15 @@ def _log_invocation_time(params, request_signer, model, **kwargs): 'start_time': start_time, 'end_time': end_time, 'first_client_invocation_time': first_client_invocation_time, + 'load_plugins_time': ( + plugin_import_end_time - plugin_import_start_time + ), + 'static_imports_time': ( + after_imports - before_imports + ), + 'create-client-time': ( + create_client_end_time - create_client_start_time + ) } ) ) @@ -333,20 +407,16 @@ def _run_isolated_benchmark( os.dup2(err.fileno(), sys.stderr.fileno()) else: with open( - os.path.abspath( - os.path.join( - args.debug_dir, - f'{benchmark["name"]}-{iteration}.txt', - ) + os.path.join( + args.debug_dir, + f'{benchmark["name"]}-{iteration}.txt', ), 'w', ) as f: with open( - os.path.abspath( - os.path.join( - args.debug_dir, - f'{benchmark["name"]}-{iteration}-err.txt', - ) + os.path.join( + args.debug_dir, + f'{benchmark["name"]}-{iteration}-err.txt', ), 'w', ) as f_err: diff --git a/scripts/performance/benchmarks.json b/scripts/performance/benchmarks.json index 4b8d7fbc2102..c22e779c7f0b 100644 --- a/scripts/performance/benchmarks.json +++ b/scripts/performance/benchmarks.json @@ -13,7 +13,7 @@ "size": 3.2e7 } ], - "config": "[default]\ns3 =\n preferred_transfer_client = classic" + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc\ns3 =\n preferred_transfer_client = classic" }, "responses": [ { @@ -41,7 +41,8 @@ "name": "test_file", "size": 3.2e7 } - ] + ], + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc\ns3 =\n preferred_transfer_client = classic" }, "responses": [ { @@ -66,7 +67,7 @@ {"name": "S3TransferClient", "value": "Classic"} ], "environment": { - "config": "[default]\ns3 =\n preferred_transfer_client = classic" + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc\ns3 =\n preferred_transfer_client = classic" }, "responses": [ { @@ -95,7 +96,7 @@ "file_size": 4e3 } ], - "config": "[default]\ns3 =\n preferred_transfer_client = classic" + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc\ns3 =\n preferred_transfer_client = classic" }, "responses": [ { @@ -116,7 +117,8 @@ "name": "key.json", "content": "{\n \"Group\": {\"S\": \"Group1\"},\n \"Item\": {\"S\": \"Item1\"} }" } - ] + ], + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" }, "responses": [ { @@ -133,7 +135,8 @@ "name": "request-items.json", "content": "{\"MyTable\": { \"Keys\": [ {\"Group\": {\"S\": \"Group1\"}, \"Item\": {\"S\": \"Item1\"}}, { \"Group\": {\"S\": \"Group1\"}, \"Item\": {\"S\": \"Item1\"} }, { \"Group\": {\"S\": \"Group1\"}, \"Item\": {\"S\": \"Item1\"} }],\"ProjectionExpression\":\"Genre\"}}" } - ] + ], + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" }, "responses": [ { @@ -150,7 +153,8 @@ "name": "item.json", "content": "{\"Group\": {\"S\": \"Group1\"},\"Item\": {\"S\": \"Item1\"},\"Category\": {\"S\": \"Category1\"}}" } - ] + ], + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" }, "responses": [ { @@ -170,7 +174,8 @@ "name": "items.json", "content": "[{\"Category\": \"Cat1\",\"Item\": \"Item1\",\"Group\": \"Group1\"}, {\"Category\": \"Cat1\",\"Item\": \"Item2\",\"Group\": \"Group2\"}, {\"Category\": \"Cat1\",\"Item\": \"Item3\",\"Group\": \"Group2\"}, {\"Category\": \"Cat2\",\"Item\": \"Item4\",\"Group\": \"Group3\"}, {\"Category\": \"Cat2\",\"Item\": \"Item5\",\"Group\": \"Group4\"}, {\"Category\": \"Cat3\",\"Item\": \"Item6\",\"Group\": \"Group5\"}, {\"Category\": \"Cat3\",\"Item\": \"Item7\",\"Group\": \"Group6\"}, {\"Category\": \"Cat3\",\"Item\": \"Item8\",\"Group\": \"Group6\"}, {\"Category\": \"Cat4\",\"Item\": \"Item9\",\"Group\": \"Group7\"}, {\"Category\": \"Cat4\",\"Item\": \"Item10\",\"Group\": \"Group4\"}]" } - ] + ], + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" }, "responses": [ { @@ -181,6 +186,9 @@ { "name": "sts.assumerole", "command": ["sts", "assume-role", "--role-arn", "arn:aws:iam::123456789012:role/role123", "--role-session-name", "role-session123"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": " arn:aws:sts::123456789012:assumed-role/role123/role-session123 id1234:role-session123 accesskeytoken1232016-03-15T00:05:07Zacesskeyid123 " @@ -190,6 +198,9 @@ { "name": "sts.getcalleridentity", "command": ["sts", "get-caller-identity"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": " arn:aws:iam::123456789012:user/user123 userid123 123456789012 " @@ -199,6 +210,9 @@ { "name": "sts.assumerolewithwebidentity", "command": ["sts", "assume-role-with-web-identity", "--duration-seconds", "3600", "--role-session-name", "session-name", "--provider-id", "www.amazon.com", "--policy-arns", "arn=arn:aws:iam::123456789012:policy/q=webidentitypolicy1", "arn=arn:aws:iam::123456789012:policy/webidentitypolicy2", "--role-arn", "arn:aws:iam::123456789012:role/FederatedRole1", "--web-identity-token", "token-123"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": " amzn1.account.tokenvalue client.12345.6789@email.address arn:aws:sts::123456789012:assumed-role/FederatedRole1/session-name roleid123:session-name session-token123 secret-access-key 2014-10-24T23:00:23Z access-key-id123 www.amazon.com" @@ -208,6 +222,9 @@ { "name": "ec2.describetags", "command": ["ec2", "describe-tags", "--filters", "Name=resource-id,Values=i-1234567890"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": " EXAMPLE i-1234567890 instance webserver i-1234567890 instance stack Production i-1234567890 instance database_server i-1234567890 instance stack Test " @@ -217,6 +234,9 @@ { "name": "ec2.describeinstances", "command": ["ec2", "describe-instances", "--instance-ids", "i-1234567890abcdef0"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": " 8f7724cf-496f-496e-8fe3-example r-1234567890abcdef0 123456789012 i-1234567890abcdef0 ami-bff32ccc 16 running ip-192-168-1-88.eu-west-1.compute.internal ec2-54-194-252-215.eu-west-1.compute.amazonaws.com my_keypair 0 t2.micro 2018-05-08T16:46:19.000Z eu-west-1c default disabled subnet-56f5f633 vpc-11112222 192.168.1.88 54.194.252.215 true sg-e4076980 SecurityGroup1 x86_64 ebs /dev/xvda /dev/xvda vol-1234567890abcdef0 attached 2015-12-22T10:44:09.000Z true hvm xMcwG14507example Name Server_1 xen eni-551ba033 subnet-56f5f633 vpc-11112222 Primary network interface 123456789012 in-use 02:dd:2c:5e:01:69 192.168.1.88 ip-192-168-1-88.eu-west-1.compute.internal true sg-e4076980 SecurityGroup1 eni-attach-39697adc 0 attached 2018-05-08T16:46:19.000Z true 54.194.252.215 ec2-54-194-252-215.eu-west-1.compute.amazonaws.com amazon 192.168.1.88 ip-192-168-1-88.eu-west-1.compute.internal true 54.194.252.215 ec2-54-194-252-215.eu-west-1.compute.amazonaws.com amazon 2001:db8:1234:1a2b::123 arn:aws:iam::123456789012:instance-profile/AdminRole ABCAJEDNCAA64SSD123AB false 1 1 " @@ -226,6 +246,9 @@ { "name": "ec2.describevolumesmodifications", "command": ["ec2", "describe-volumes-modifications", "--volume-ids", "vol-0123456789EXAMPLE"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": " 59dbff89-35bd-4eac-99ed-be587EXAMPLE 10000 300 optimizing 200 io1 vol-0123456789EXAMPLE 40 2017-01-19T23:58:04.922Z 100 gp2 false true " @@ -235,6 +258,9 @@ { "name": "ecs.describecontainerinstances", "command": ["ecs", "describe-container-instances", "--cluster", "update", "--container-instances", "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": "{ \"containerInstances\": [ { \"agentConnected\": true, \"attributes\": [ { \"name\": \"com.amazonaws.ecs.capability.privileged-container\" }, { \"name\": \"com.amazonaws.ecs.capability.docker-remote-api.1.17\" }, { \"name\": \"com.amazonaws.ecs.capability.docker-remote-api.1.18\" }, { \"name\": \"com.amazonaws.ecs.capability.docker-remote-api.1.19\" }, { \"name\": \"com.amazonaws.ecs.capability.docker-remote-api.1.20\" }, { \"name\": \"com.amazonaws.ecs.capability.docker-remote-api.1.21\" }, { \"name\": \"com.amazonaws.ecs.capability.logging-driver.json-file\" }, { \"name\": \"com.amazonaws.ecs.capability.logging-driver.syslog\" }, { \"name\": \"com.amazonaws.ecs.capability.logging-driver.awslogs\" }, { \"name\": \"com.amazonaws.ecs.capability.ecr-auth\" } ], \"containerInstanceArn\": \"arn:aws:ecs:us-west-2:012345678910:container-instance/default/f9cc75bb-0c94-46b9-bf6d-49d320bc1551\", \"ec2InstanceId\": \"i-042f39dc\", \"pendingTasksCount\": 0, \"registeredResources\": [ { \"doubleValue\": 0, \"integerValue\": 1024, \"longValue\": 0, \"name\": \"CPU\", \"type\": \"INTEGER\" }, { \"doubleValue\": 0, \"integerValue\": 995, \"longValue\": 0, \"name\": \"MEMORY\", \"type\": \"INTEGER\" }, { \"doubleValue\": 0, \"integerValue\": 0, \"longValue\": 0, \"name\": \"PORTS\", \"stringSetValue\": [ \"22\", \"2376\", \"2375\", \"51678\" ], \"type\": \"STRINGSET\" }, { \"doubleValue\": 0, \"integerValue\": 0, \"longValue\": 0, \"name\": \"PORTS_UDP\", \"stringSetValue\": [], \"type\": \"STRINGSET\" } ], \"remainingResources\": [ { \"doubleValue\": 0, \"integerValue\": 1024, \"longValue\": 0, \"name\": \"CPU\", \"type\": \"INTEGER\" }, { \"doubleValue\": 0, \"integerValue\": 995, \"longValue\": 0, \"name\": \"MEMORY\", \"type\": \"INTEGER\" }, { \"doubleValue\": 0, \"integerValue\": 0, \"longValue\": 0, \"name\": \"PORTS\", \"stringSetValue\": [ \"22\", \"2376\", \"2375\", \"51678\" ], \"type\": \"STRINGSET\" }, { \"doubleValue\": 0, \"integerValue\": 0, \"longValue\": 0, \"name\": \"PORTS_UDP\", \"stringSetValue\": [], \"type\": \"STRINGSET\" } ], \"runningTasksCount\": 0, \"status\": \"ACTIVE\", \"version\": 850, \"versionInfo\": { \"agentHash\": \"0931217\", \"agentVersion\": \"1.9.0\", \"dockerVersion\": \"DockerVersion: 1.9.1\" } } ], \"failures\": [] }" @@ -244,6 +270,9 @@ { "name": "ecs.describetasks", "command": ["ecs", "describe-tasks", "--cluster", "default", "--tasks", "1dc5c17a-422b-4dc4-b493-371970c6c4d6"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": "{ \"failures\": [], \"tasks\": [ { \"taskArn\": \"arn:aws:ecs:us-east-1:012345678910:task/1dc5c17a-422b-4dc4-b493-371970c6c4d6\", \"overrides\": { \"containerOverrides\": [ { \"name\": \"simple-app\" }, { \"name\": \"busybox\" } ] }, \"lastStatus\": \"RUNNING\", \"containerInstanceArn\": \"arn:aws:ecs:us-east-1:012345678910:container-instance/default/5991d8da-1d59-49d2-a31f-4230f9e73140\", \"createdAt\": 1476822811.295, \"version\": 0, \"clusterArn\": \"arn:aws:ecs:us-east-1:012345678910:cluster/default\", \"startedAt\": 1476822833.998, \"desiredStatus\": \"RUNNING\", \"taskDefinitionArn\": \"arn:aws:ecs:us-east-1:012345678910:task-definition/console-sample-app-dynamic-ports:1\", \"startedBy\": \"ecs-svc/9223370560032507596\", \"containers\": [ { \"containerArn\": \"arn:aws:ecs:us-east-1:012345678910:container/4df26bb4-f057-467b-a079-961675296e64\", \"taskArn\": \"arn:aws:ecs:us-east-1:012345678910:task/default/1dc5c17a-422b-4dc4-b493-371970c6c4d6\", \"lastStatus\": \"RUNNING\", \"name\": \"simple-app\", \"networkBindings\": [ { \"protocol\": \"tcp\", \"bindIP\": \"0.0.0.0\", \"containerPort\": 80, \"hostPort\": 32774 } ], \"runtimeId\": \"runtime-123\" }, { \"containerArn\": \"arn:aws:ecs:us-east-1:012345678910:container/e09064f7-7361-4c87-8ab9-8d073bbdbcb9\", \"taskArn\": \"arn:aws:ecs:us-east-1:012345678910:task/default/1dc5c17a-422b-4dc4-b493-371970c6c4d6\", \"lastStatus\": \"RUNNING\", \"name\": \"busybox\", \"networkBindings\": [] } ] } ] }" @@ -253,6 +282,9 @@ { "name": "ecs.listcontainerinstances", "command": ["ecs", "list-container-instances", "--cluster", "example"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": "{ \"containerInstanceArns\": [ \"arn:aws:ecs:us-east-1:012345678910:container-instance/example/1eb22c8ab33149b397dc769f68cc1319\", \"arn:aws:ecs:us-east-1:012345678910:container-instance/example/5cf7e311a2b74d3882650353cf3b2214\" ] }" @@ -262,6 +294,9 @@ { "name": "logs.putlogevents", "command": ["logs", "put-log-events", "--log-group-name", "my-logs", "--log-stream-name", "20150601", "--log-events", "[\n {\n \"timestamp\": 1433190184356,\n \"message\": \"Example Event 1\"\n },\n {\n \"timestamp\": 1433190184358,\n \"message\": \"Example Event 2\"\n },\n {\n \"timestamp\": 1433190184360,\n \"message\": \"Example Event 3\"\n }\n]"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": "{ \"nextSequenceToken\": \"token123\"}" @@ -271,6 +306,9 @@ { "name": "logs.createloggroup", "command": ["logs", "create-log-group", "--log-group-name", "my-logs"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": "" @@ -280,6 +318,9 @@ { "name": "cloudwatch.putmetricdata", "command": ["cloudwatch", "put-metric-data", "--namespace", "Usage Metrics", "--metric-data", "[\n {\n \"MetricName\": \"New Posts\",\n \"Timestamp\": \"Wednesday, June 12, 2013 8:28:20 PM\",\n \"Value\": 0.50,\n \"Unit\": \"Count\"\n }\n]\n"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": "" @@ -289,6 +330,9 @@ { "name": "cloudwatch.getmetricstatistics", "command": ["cloudwatch", "get-metric-statistics", "--metric-name", "CPUUtilization", "--start-time", "2014-04-08T23:18:00Z", "--end-time", "2014-04-09T23:18:00Z", "--period", "3600", "--namespace", "AWS/EC2", "--statistics", "Maximum", "--dimensions", "Name=InstanceId,Value=i-abcdef"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": " \n 2014-04-09T11:18:00Z\n 44.79\n Percent\n \n \n 2014-04-09T20:18:00Z\n 47.92\n Percent\n \n \n 2014-04-09T19:18:00Z\n 50.85\n Percent\n \n \n 2014-04-09T09:18:00Z\n 47.92\n Percent\n \n \n 2014-04-09T03:18:00Z\n 76.84\n Percent\n \n \n 2014-04-09T21:18:00Z\n 48.96\n Percent\n \n \n 2014-04-09T14:18:00Z\n 47.92\n Percent\n \n \n 2014-04-09T08:18:00Z\n 47.92\n Percent\n " @@ -298,6 +342,9 @@ { "name": "cloudwatch.getmetricdata", "command": ["cloudwatch", "get-metric-data", "--metric-data-queries", "[ { \"Id\": \"m3\", \"Expression\": \"(m1+m2)/300\", \"Label\": \"Avg Total IOPS\" }, { \"Id\": \"m1\", \"MetricStat\": { \"Metric\": { \"Namespace\": \"AWS/EC2\", \"MetricName\": \"EBSReadOps\", \"Dimensions\": [ { \"Name\": \"InstanceId\", \"Value\": \"i-abcdef\" } ] }, \"Period\": 300, \"Stat\": \"Sum\", \"Unit\": \"Count\" }, \"ReturnData\": false }, { \"Id\": \"m2\", \"MetricStat\": { \"Metric\": { \"Namespace\": \"AWS/EC2\", \"MetricName\": \"EBSWriteOps\", \"Dimensions\": [ { \"Name\": \"InstanceId\", \"Value\": \"i-abcdef\" } ] }, \"Period\": 300, \"Stat\": \"Sum\", \"Unit\": \"Count\" }, \"ReturnData\": false } ]", "--start-time", "2024-09-29T22:10:00Z", "--end-time", "2024-09-29T22:15:00Z"], + "environment": { + "config": "[default]\nAWS_ACCESS_KEY_ID=abc\nAWS_SECRET_ACCESS_KEY=abc\nAWS_SESSION_TOKEN=abc" + }, "responses": [ { "body": " m3 2024-09-29T22:10:00+00:00 96.85 Complete " diff --git a/scripts/performance/run-benchmarks b/scripts/performance/run-benchmarks index db42067e1a7a..c7ab4ad7bce9 100755 --- a/scripts/performance/run-benchmarks +++ b/scripts/performance/run-benchmarks @@ -89,6 +89,9 @@ def main(): "--chunk-id must be an integer between 0 (inclusive) and num-chunks (exclusive)." ) + if parsed_args.debug_dir is not None: + parsed_args.debug_dir = os.path.abspath(parsed_args.debug_dir) + test_suites = harness.get_test_suites(parsed_args) test_cases = [] for suite in test_suites: