[mlpack-svn] r15609 - in mlpack/conf/jenkins-conf/benchmark: benchmark util
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Aug 12 15:29:12 EDT 2013
Author: marcus
Date: Mon Aug 12 15:29:12 2013
New Revision: 15609
Log:
Add line chart for every method.
Modified:
mlpack/conf/jenkins-conf/benchmark/benchmark/make_reports.py
mlpack/conf/jenkins-conf/benchmark/util/database.py
mlpack/conf/jenkins-conf/benchmark/util/template.py
Modified: mlpack/conf/jenkins-conf/benchmark/benchmark/make_reports.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/benchmark/make_reports.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/benchmark/make_reports.py Mon Aug 12 15:29:12 2013
@@ -121,12 +121,22 @@
methodResults.append(results)
if methodResults:
- # Generate a "unique" name for the bar chart.
- chartName = "img/bar_" + str(hash(str(method[1:]) + str(buildIds))) + ".png"
+ # Generate a "unique" hash for the chart names.
+ chartHash = str(hash(str(method[1:]) + str(buildIds)))
+
+ # Generate a "unique" name for the line chart.
+ lineChartName = "img/line_" + chartHash + ".png"
+
+ # Create the line chart.
+ build, methodResultsSum = db.GetResultsMethodSum("mlpack", method[0])
+ GenerateSingleLineChart(methodResultsSum, "reports/" + lineChartName)
+ # Generate a "unique" name for the bar chart.
+ barChartName = "img/bar_" + chartHash + ".png"
+
# Create the bar chart.
ChartInfo = GenerateBarChart(methodResults, methodLibararies,
- "reports/" + chartName)
+ "reports/" + barChartName)
numDatasets, totalTime, failure, timeouts, bestLibCount, timingData = ChartInfo
# Create the timing table.
@@ -143,7 +153,8 @@
reportValues["progressPositive"] = "{0:.2f}".format(100 - negative) + "%"
reportValues["progressNegative"] = "{0:.2f}".format(negative) + "%"
- reportValues["barChart"] = chartName
+ reportValues["barChart"] = barChartName
+ reportValues["lineChart"] = lineChartName
reportValues["numLibararies"] = str(len(methodLibararies))
reportValues["numDatasets"] = numDatasets
reportValues["totalTime"] = totalTime
Modified: mlpack/conf/jenkins-conf/benchmark/util/database.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/util/database.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/util/database.py Mon Aug 12 15:29:12 2013
@@ -285,4 +285,22 @@
" results.dataset_id = datasets.id WHERE build_id=" + str(buildId) +
" AND method_id=" + str(methodId) + " ORDER BY datasets.name")
return self.cur.fetchall()
+
+ '''
+ Get the sum of the time column of all build of the given method.
+ @param name - The name of the library.
+ @param methodId - The method id.
+ @return The sum of the time column.
+ '''
+ def GetResultsMethodSum(self, name, methodId):
+ libaryId = self.GetLibrary(name)[0][0]
+ with self.con:
+ self.cur.execute("SELECT id FROM builds WHERE libary_id=" + str(libaryId)
+ + " ORDER BY build ASC")
+ timeSummed = []
+ for buildId in self.cur.fetchall():
+ self.cur.execute("SELECT SUM(time) FROM results WHERE build_id=" +
+ str(buildId[0]) + " AND method_id=" + str(methodId))
+ timeSummed.append(self.cur.fetchall()[0][0])
+ return (buildId[0], timeSummed)
Modified: mlpack/conf/jenkins-conf/benchmark/util/template.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/util/template.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/util/template.py Mon Aug 12 15:29:12 2013
@@ -87,6 +87,9 @@
</div>
<div id="collapseOne" class="container__bottomContent graph collapse">
<div>
+ <img class="center--image" src="%(lineChart)s" alt="">
+ </div>
+ <div>
<img class="center--image" src="%(barChart)s" alt="">
</div>
<div>
More information about the mlpack-svn
mailing list