Commit be1df51c authored by behdad's avatar behdad Committed by Commit Bot

Adjust_upper_limits uses luci-go instead of swarming-client

Script is updated to use luci-go/swarming instead of swarming client
which is being deprecated.

Bug: chromium:1050450
Change-Id: I9297bd2f1387cf1b58c262ce8363e291756c7059
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2062550Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarTakuto Ikuta <tikuta@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Auto-Submit: Behdad Bakhshinategh <behdadb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742846}
parent 5898b5e3
......@@ -20,8 +20,7 @@ from core.external_modules import pandas
RUNS_USED_FOR_LIMIT_UPDATE = 30
CHANGE_PERCENTAGE_LIMIT = 0.01
SWARMING_PATH = os.path.join(
CHROMIUM_PATH, 'tools', 'swarming_client', 'swarming.py')
SWARMING_PATH = os.path.join(CHROMIUM_PATH, 'tools', 'luci-go', 'swarming')
UPPER_LIMITS_DATA_DIR = os.path.join(
CHROMIUM_PATH, 'testing', 'scripts', 'representative_perf_test_data')
......@@ -36,16 +35,15 @@ def FetchItemIds(tags, limit):
Returns:
A list containing the item Id of the tasks.
"""
swarming_attributes = (
'tasks/list?tags=name:rendering_representative_perf_tests&tags=os:{os}'
'&tags=buildername:{buildername}&tags=master:chromium.gpu.fyi&state='
'COMPLETED&fields=cursor,items(task_id)').format(**tags)
query = [
SWARMING_PATH, 'query', '-S', 'chromium-swarm.appspot.com', '--limit',
str(limit), swarming_attributes]
output = json.loads(subprocess.check_output(query))
return output.get('items')
SWARMING_PATH, 'tasks', '-S', 'chromium-swarm.appspot.com', '-limit',
str(limit), '-state=COMPLETED', '-field', 'items(task_id)', '-tag',
'master:chromium.gpu.fyi', '-tag', 'os:{os}'.format(**tags), '-tag',
'name:rendering_representative_perf_tests', '-tag',
'buildername:{buildername}'.format(**tags)
]
return json.loads(subprocess.check_output(query))
def FetchItemData(task_id, benchmark, index, temp_dir):
......@@ -60,18 +58,17 @@ def FetchItemData(task_id, benchmark, index, temp_dir):
Returns:
A data_frame containing the averages and confidence interval ranges.
"""
output_directory = os.path.abspath(
os.path.join(temp_dir, task_id))
query = [
SWARMING_PATH, 'collect', '-S', 'chromium-swarm.appspot.com',
'--task-output-dir', output_directory, task_id]
'-output-dir', temp_dir, '-perf', task_id
]
try:
subprocess.check_output(query)
except Exception as e:
print(e)
result_file_path = os.path.join(
output_directory, '0', 'rendering.' + benchmark, 'perf_results.csv')
result_file_path = os.path.join(temp_dir, task_id, 'rendering.' + benchmark,
'perf_results.csv')
try:
df = pandas.read_csv(result_file_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment