Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: tools/swarming_load_test_client.py

Issue 29783003: Fix config typo in load tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/swarm_client
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/swarming_load_test_bot.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Triggers a ton of fake jobs to test its handling under high load. 6 """Triggers a ton of fake jobs to test its handling under high load.
7 7
8 Generates an histogram with the latencies to process the tasks and number of 8 Generates an histogram with the latencies to process the tasks and number of
9 retries. 9 retries.
10 """ 10 """
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 """Triggers a Swarming job and collects results. 57 """Triggers a Swarming job and collects results.
58 58
59 Returns the total amount of time to run a task remotely, including all the 59 Returns the total amount of time to run a task remotely, including all the
60 overhead. 60 overhead.
61 """ 61 """
62 name = 'load-test-%d-%s' % (index, unique) 62 name = 'load-test-%d-%s' % (index, unique)
63 start = time.time() 63 start = time.time()
64 64
65 logging.info('trigger') 65 logging.info('trigger')
66 manifest = swarming.Manifest( 66 manifest = swarming.Manifest(
67 None, name, 1, None, 'Comodor64', '', 'http://localhost:1', False, False, 67 None, name, 1, None, swarming_load_test_bot.OS_NAME, '',
68 100, None) 68 'http://localhost:1', False, False, 100, None)
69 data = {'request': manifest.to_json()} 69 data = {'request': manifest.to_json()}
70 response = net.url_open(swarming_url + '/test', data=data) 70 response = net.url_open(swarming_url + '/test', data=data)
71 if not response: 71 if not response:
72 # Failed to trigger. Return a failure. 72 # Failed to trigger. Return a failure.
73 return 'failed_trigger' 73 return 'failed_trigger'
74 result = json.load(response) 74 result = json.load(response)
75 test_key = result['test_keys'][0].pop('test_key') 75 test_key = result['test_keys'][0].pop('test_key')
76 assert test_key 76 assert test_key
77 expected = { 77 expected = {
78 'test_case_name': name, 78 'test_case_name': name,
79 'test_keys': [ 79 'test_keys': [
80 { 80 {
81 'config_name': 'Comodor64', 81 'config_name': swarming_load_test_bot.OS_NAME,
82 'num_instances': 1, 82 'num_instances': 1,
83 'instance_index': 0, 83 'instance_index': 0,
84 }, 84 },
85 ], 85 ],
86 } 86 }
87 assert result == expected, result 87 assert result == expected, result
88 progress.update_item('%5d' % index, processing=1) 88 progress.update_item('%5d' % index, processing=1)
89 try: 89 try:
90 logging.info('collect') 90 logging.info('collect')
91 test_keys = swarming.get_test_keys(swarming_url, name) 91 test_keys = swarming.get_test_keys(swarming_url, name)
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 print('') 217 print('')
218 print_results(results, options.columns, options.buckets) 218 print_results(results, options.columns, options.buckets)
219 if options.dump: 219 if options.dump:
220 with open(options.dump, 'w') as f: 220 with open(options.dump, 'w') as f:
221 json.dump(results, f, separators=(',',':')) 221 json.dump(results, f, separators=(',',':'))
222 return 0 222 return 0
223 223
224 224
225 if __name__ == '__main__': 225 if __name__ == '__main__':
226 sys.exit(main()) 226 sys.exit(main())
OLDNEW
« no previous file with comments | « tools/swarming_load_test_bot.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698