summaryrefslogtreecommitdiffstats
path: root/scripts/computerankings.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/computerankings.py')
-rwxr-xr-xscripts/computerankings.py24
1 files changed, 8 insertions, 16 deletions
diff --git a/scripts/computerankings.py b/scripts/computerankings.py
index 6726806..e5165ce 100755
--- a/scripts/computerankings.py
+++ b/scripts/computerankings.py
@@ -115,19 +115,11 @@ def registerRanking(table, stat_index, stat_name, context1_id, context2_id):
prev_stat_value = stat_value
# Insert or update the corresponding row in the 'ranking' table:
- query = (
- "SELECT merge_ranking("
- + str(context1_id)
- + ", " + str(context2_id)
- + ", " + str(benchmark_id)
- + ", " + str(metric_id)
- + ", " + str(lc_timestamp)
- + ", " + str(stat_id)
- + ", " + str(stat_value)
- + ", " + str(ranking_pos)
- + ");"
- )
- execQuery(query, False)
+ execQuery(
+ "SELECT merge_ranking(%s, %s, %s, %s, %s, %s, %s, %s)",
+ (context1_id, context2_id, benchmark_id, metric_id,
+ lc_timestamp, stat_id, stat_value, ranking_pos),
+ False)
# ### 2 B DOCUMENTED!
@@ -255,13 +247,13 @@ def updateRankings(
try:
sha12_pos = zip(*snapshots)[0].index(sha12_id)
except ValueError:
- print "no observations found for SHA-1 ID:", sha12_id
+ sys.stderr.write("no observations found for SHA-1 ID: " + str(sha12_id))
sys.exit(1)
sha11_pos = max(0, (sha12_pos - 2 * durtolmax) + 1)
snapshots = snapshots[sha11_pos:(sha12_pos + 1)]
if len(snapshots) < 2:
- print (
- "no observations found before SHA-1 ID: " + sha12_id +
+ sys.stderr.write(
+ "no observations found before SHA-1 ID: " + str(sha12_id) +
" (computing rankings makes no sense)")
sys.exit(1)