summaryrefslogtreecommitdiffstats
path: root/scripts/getstats1.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/getstats1.py')
-rw-r--r--scripts/getstats1.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/getstats1.py b/scripts/getstats1.py
index b6e6b93..8ed1cbc 100644
--- a/scripts/getstats1.py
+++ b/scripts/getstats1.py
@@ -1,7 +1,8 @@
from dbaccess import execQuery, database
from singlecontextbmstats import (
SingleContextBMStats, extractSingleContextBMStats)
-from misc import idToText, textToId, benchmarkToComponents, printJSONHeader
+from misc import idToText, textToId, benchmarkToComponents, printJSONHeader,
+ getContext
class GetStats1:
@@ -64,12 +65,13 @@ class GetStats1:
# SingleContextBMStats objects.
def computeBMStatsList(self):
+ # Get the context
+ context = getContext(self.host_id, self.platform_id,
+ self.branch_id, self.sha1_id)
+
# Get all distinct benchmark/metric combinations matching the context:
- bmark_metrics = execQuery(
- "SELECT DISTINCT benchmarkId, metricId " +
- "FROM result WHERE hostId = " + str(self.host_id) +
- " AND platformId = " + str(self.platform_id) + " AND branchId = " +
- str(self.branch_id) + " AND sha1Id = " + str(self.sha1_id) + ";")
+ bmark_metrics = execQuery("SELECT DISTINCT benchmarkId, metricId"
+ " FROM result WHERE contextId = %d;" % context)
bmstats_list = []