Fetch try commits on perf bot
Change-Id: Ief907ce3f00aae86d2e171767007693ec6793c6f
diff --git a/tools/historic_run.py b/tools/historic_run.py
index b153276..9de2e91 100755
--- a/tools/historic_run.py
+++ b/tools/historic_run.py
@@ -125,9 +125,15 @@
def git_commit_from_hash(hash):
# If there is a tag for the given commit then the commit timestamp is on the
# last line.
- commit_timestamp_str = subprocess.check_output(
- ['git', 'show', '--no-patch', '--no-notes', '--pretty=%ct',
- hash]).decode('utf-8').strip().splitlines()[-1]
+ commit_timestamp_cmd = ['git', 'show', '--no-patch', '--no-notes', '--pretty=%ct',
+ hash]
+ try:
+ commit_timestamp_raw = subprocess.check_output(commit_timestamp_cmd)
+ except subprocess.CalledProcessError as e:
+ # Try to fetch the hash. This may be needed for try commits.
+ subprocess.check_output(['git', 'fetch', 'origin', hash])
+ commit_timestamp_raw = subprocess.check_output(commit_timestamp_cmd)
+ commit_timestamp_str = commit_timestamp_raw.decode('utf-8').strip().splitlines()[-1]
commit_timestamp = int(commit_timestamp_str)
destination_dir = '%s/%s/' % (MASTER_COMMITS, hash)
destination = '%s%s' % (destination_dir, 'r8.jar')
diff --git a/tools/upload_benchmark_data_to_google_storage.py b/tools/upload_benchmark_data_to_google_storage.py
index e93a58b..23a4a2a 100755
--- a/tools/upload_benchmark_data_to_google_storage.py
+++ b/tools/upload_benchmark_data_to_google_storage.py
@@ -14,6 +14,7 @@
import re
import subprocess
import sys
+import time
TARGETS = ['r8-full']
NUM_COMMITS = 1000
@@ -27,11 +28,14 @@
def DownloadCloudBucket(dest):
os.makedirs(dest)
+ start = time.time()
utils.download_file_from_cloud_storage(perf.GetGSLocation('*'),
dest,
concurrent=True,
quiet=True,
flags=['-R'])
+ end = time.time()
+ print("Download bucket finished in %ss" % (end - start))
def GetMainCommits():