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 ...@@ -20,8 +20,7 @@ from core.external_modules import pandas
RUNS_USED_FOR_LIMIT_UPDATE = 30 RUNS_USED_FOR_LIMIT_UPDATE = 30
CHANGE_PERCENTAGE_LIMIT = 0.01 CHANGE_PERCENTAGE_LIMIT = 0.01
SWARMING_PATH = os.path.join( SWARMING_PATH = os.path.join(CHROMIUM_PATH, 'tools', 'luci-go', 'swarming')
CHROMIUM_PATH, 'tools', 'swarming_client', 'swarming.py')
UPPER_LIMITS_DATA_DIR = os.path.join( UPPER_LIMITS_DATA_DIR = os.path.join(
CHROMIUM_PATH, 'testing', 'scripts', 'representative_perf_test_data') CHROMIUM_PATH, 'testing', 'scripts', 'representative_perf_test_data')
...@@ -36,16 +35,15 @@ def FetchItemIds(tags, limit): ...@@ -36,16 +35,15 @@ def FetchItemIds(tags, limit):
Returns: Returns:
A list containing the item Id of the tasks. 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 = [ query = [
SWARMING_PATH, 'query', '-S', 'chromium-swarm.appspot.com', '--limit', SWARMING_PATH, 'tasks', '-S', 'chromium-swarm.appspot.com', '-limit',
str(limit), swarming_attributes] str(limit), '-state=COMPLETED', '-field', 'items(task_id)', '-tag',
output = json.loads(subprocess.check_output(query)) 'master:chromium.gpu.fyi', '-tag', 'os:{os}'.format(**tags), '-tag',
return output.get('items') '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): def FetchItemData(task_id, benchmark, index, temp_dir):
...@@ -60,18 +58,17 @@ def FetchItemData(task_id, benchmark, index, temp_dir): ...@@ -60,18 +58,17 @@ def FetchItemData(task_id, benchmark, index, temp_dir):
Returns: Returns:
A data_frame containing the averages and confidence interval ranges. A data_frame containing the averages and confidence interval ranges.
""" """
output_directory = os.path.abspath(
os.path.join(temp_dir, task_id))
query = [ query = [
SWARMING_PATH, 'collect', '-S', 'chromium-swarm.appspot.com', SWARMING_PATH, 'collect', '-S', 'chromium-swarm.appspot.com',
'--task-output-dir', output_directory, task_id] '-output-dir', temp_dir, '-perf', task_id
]
try: try:
subprocess.check_output(query) subprocess.check_output(query)
except Exception as e: except Exception as e:
print(e) print(e)
result_file_path = os.path.join( result_file_path = os.path.join(temp_dir, task_id, 'rendering.' + benchmark,
output_directory, '0', 'rendering.' + benchmark, 'perf_results.csv') 'perf_results.csv')
try: try:
df = pandas.read_csv(result_file_path) df = pandas.read_csv(result_file_path)
...@@ -209,4 +206,4 @@ def RecalculateUpperLimits(data_point_count): ...@@ -209,4 +206,4 @@ def RecalculateUpperLimits(data_point_count):
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(RecalculateUpperLimits(RUNS_USED_FOR_LIMIT_UPDATE)) sys.exit(RecalculateUpperLimits(RUNS_USED_FOR_LIMIT_UPDATE))
\ No newline at end of file
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