summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2011-02-16 18:58:09 +0100
committerjasplin <qt-info@nokia.com>2011-02-16 18:58:09 +0100
commita5722e4bbbc547ad034f3ea28b8efe9e8e035c6c (patch)
treec68d04f92e867819b210a4b9deb7a492d0ad2427 /scripts
parentd62a2485ad68716cd6753ec34893ee04476ec693 (diff)
Included LCDA (Last Change Days Ago) in ranking table.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/finalizeresults.py10
-rw-r--r--scripts/getrankings.py14
2 files changed, 15 insertions, 9 deletions
diff --git a/scripts/finalizeresults.py b/scripts/finalizeresults.py
index 04c453e..17d2bbe 100755
--- a/scripts/finalizeresults.py
+++ b/scripts/finalizeresults.py
@@ -81,6 +81,7 @@ def registerRanking(table, stat_index, stat_name, context1_id, context2_id):
for row in table:
benchmark_id = row[0]
metric_id = row[1]
+ lc_timestamp = row[2]
stat_value = row[stat_index]
# The following statement ensures the following conditions:
@@ -106,6 +107,7 @@ def registerRanking(table, stat_index, stat_name, context1_id, context2_id):
+ ", " + str(context2_id)
+ ", " + str(benchmark_id)
+ ", " + str(metric_id)
+ + ", " + str(lc_timestamp)
+ ", " + str(stat_id)
+ ", " + str(stat_value)
+ ", " + str(ranking_pos)
@@ -128,6 +130,7 @@ def getAllRankingStats(bmstats_list):
benchmark_id = stats["benchmark_id"]
metric_id = stats["metric_id"]
+ lc_timestamp = stats["lc_timestamp"]
lsd = stats["lsd"]
ni = stats["ni"]
nz = stats["nz"]
@@ -158,7 +161,8 @@ def getAllRankingStats(bmstats_list):
lcssr = lcssi = lcss1r = lcss1i = -1
table.append(
- (benchmark_id, metric_id, qs, lcssr, lcssi, lcss1r, lcss1i))
+ (benchmark_id, metric_id, lc_timestamp, qs, lcssr, lcssi, lcss1r,
+ lcss1i))
return table
@@ -192,7 +196,7 @@ def updateRankings(host_id, platform_id, branch_id, sha12_id, context2_id):
force_cond = empty_cond = interval_cond = False
force_ranking = False
- #force_ranking = True # Uncomment for testing
+ force_ranking = True # Uncomment for testing
force_cond = force_ranking
@@ -269,7 +273,7 @@ def updateRankings(host_id, platform_id, branch_id, sha12_id, context2_id):
if context1_id == -1:
print "fatal error: failed to find context for start snapshot"
sys.exit(1)
- nameToIndex = { "QS": 2, "LCSSR": 3, "LCSSI": 4, "LCSS1R": 5, "LCSS1I": 6 }
+ nameToIndex = { "QS": 3, "LCSSR": 4, "LCSSI": 5, "LCSS1R": 6, "LCSS1I": 7 }
for name in nameToIndex:
sys.stdout.write("registering ranking for " + name + " ...\r")
sys.stdout.flush()
diff --git a/scripts/getrankings.py b/scripts/getrankings.py
index 11773b9..1ed2f3b 100644
--- a/scripts/getrankings.py
+++ b/scripts/getrankings.py
@@ -65,7 +65,8 @@ class GetRankings:
# Get the unsorted ranking information:
ranking_all = execQuery(
- "SELECT benchmarkId, metricId, context1Id, pos, value"
+ "SELECT benchmarkId, metricId, context1Id, pos, value,"
+ " lastChangeTimestamp"
" FROM ranking"
" WHERE context2Id = %d"
" AND statId = %d;"
@@ -109,9 +110,11 @@ class GetRankings:
# Append deltas where applicable:
ranking_without_deltas = ranking
ranking = []
- for (benchmark_id, metric_id, context1_id, pos, value
- ) in ranking_without_deltas:
- row = [benchmark_id, metric_id, context1_id, pos, value]
+
+ for (benchmark_id, metric_id, context1_id, pos, value,
+ lc_timestamp) in ranking_without_deltas:
+ row = [benchmark_id, metric_id, context1_id, pos, value,
+ lc_timestamp]
if pos >= 0:
pos_prev = ranking_prev[benchmark_id, metric_id]
if pos_prev >= 0:
@@ -120,7 +123,6 @@ class GetRankings:
ranking.append(row)
-
# Add to main list:
rankings[stat_name.lower()] = ranking;
@@ -183,7 +185,7 @@ class GetRankings:
'snapshots': map(
lambda s: (idToText("sha1", s[0]), s[1]), self.snapshots),
'rankings': self.rankings
- }, sys.stdout)
+ }, sys.stdout, indent=4)
class GetRankingsAsJSON(GetRankings):