[mlpack-svn] r15887 - in mlpack/conf/jenkins-conf/benchmark: . benchmark

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Oct 1 06:49:14 EDT 2013


Author: marcus
Date: Tue Oct  1 06:49:13 2013
New Revision: 15887

Log:
Add option to set the chart color.

Modified:
   mlpack/conf/jenkins-conf/benchmark/benchmark/make_reports.py
   mlpack/conf/jenkins-conf/benchmark/config.yaml

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	Tue Oct  1 06:49:13 2013
@@ -33,7 +33,7 @@
 @param db - The database object.
 @return The filename of the line chart.
 '''
-def CreateTopLineChart(db):
+def CreateTopLineChart(db, topChartColor):
   res = db.GetResultsSum("mlpack")
   if res:
     build, results = res
@@ -41,7 +41,7 @@
     return ""
 
   GenerateSingleLineChart(results, "reports/img/mlpack_top_" + str(build) + 
-      ".png", backgroundColor="#F3F3F3", windowWidth=9, windowHeight=1.6)
+      ".png", backgroundColor=topChartColor, windowWidth=9, windowHeight=1.6)
   return "img/mlpack_top_" + str(build) + ".png"
 
 '''
@@ -116,7 +116,7 @@
 @param results - This data structure contains the memory results.
 @return A string that contains the content for the memory section.
 '''
-def CreateMemoryContent(results):
+def CreateMemoryContent(results, chartColor):
   memoryContent = ""
   if results:
     for result in results:
@@ -132,7 +132,7 @@
       memoryValues["content"] = content
 
       filename = "img/massif_" + os.path.basename(result[5]).split('.')[0] + ".png"
-      CreateMassifChart(result[5], "reports/" + filename)
+      CreateMassifChart(result[5], "reports/" + filename, chartColor)
       memoryValues["memoryChart"] = filename
 
       memoryContent += memoryPanelTemplate % memoryValues
@@ -169,7 +169,7 @@
 @param db - The database object.
 @return HTML code which contains the information for the container.
 '''
-def MethodReports(db):
+def MethodReports(db, chartColor):
   methodsPage = ""
   numDatasets = 0
 
@@ -246,14 +246,17 @@
       else:
         continue
 
-      GenerateSingleLineChart(methodResultsSum, "reports/" + lineChartName)
+      GenerateSingleLineChart(methodResultsSum, "reports/" + lineChartName, 
+          chartColor)
 
       # Generate a "unique" name for the bar chart.
       barChartName = "img/bar_" + chartHash + ".png"
 
       # Create the bar chart.
-      ChartInfo = GenerateBarChart(methodResults, methodLibararies, 
-          "reports/" + barChartName)
+      ChartInfo = GenerateBarChart(results=methodResults, 
+          libraries=methodLibararies, fileName="reports/" + barChartName, 
+          backgroundColor=chartColor)
+
       numDatasets, totalTime, failure, timeouts, bestLibnum, timingData = ChartInfo
 
       # Increase the status information.
@@ -287,9 +290,10 @@
 
       # Create the memory content.
       if mlpackMemoryBuilId:
-        memoryResults = db.GetMemoryResults(mlpackMemoryBuilId, mlpackMemoryId[0][0], methodId)
+        memoryResults = db.GetMemoryResults(mlpackMemoryBuilId, 
+            mlpackMemoryId[0][0], methodId)
 
-        groupPanel["content"] = CreateMemoryContent(memoryResults)
+        groupPanel["content"] = CreateMemoryContent(memoryResults, chartColor)
         if groupPanel["content"]:
           groupPanel["nameID"] = chartHash + "_m"
           groupPanel["name"] = "Parameters: " + (parameters if parameters else "None")
@@ -464,6 +468,8 @@
   # Report settings.
   database = "reports/benchmark.db"
   keepReports = 3
+  topChartColor = "#F3F3F3"
+  chartColor = "#FFFFFF"
 
   # Create the folder structure.
   CreateDirectoryStructure(["reports/img", "reports/etc"])
@@ -479,6 +485,10 @@
         database = value
       elif key == "keepReports":
         keepReports = value
+      elif key == "topChartColor":
+        topChartColor = value
+      elif key == "chartColor":
+        chartColor = value
 
   db = Database(database)
   db.CreateTables()
@@ -488,9 +498,9 @@
 
   # Get the values for the new index.html file.
   reportValues = {}
-  reportValues["topLineChart"] = CreateTopLineChart(db)
+  reportValues["topLineChart"] = CreateTopLineChart(db, topChartColor)
   reportValues["pagination"] = NewPagination()
-  reportValues["methods"] = MethodReports(db)
+  reportValues["methods"] = MethodReports(db, chartColor)
 
   template = pageTemplate % reportValues
 

Modified: mlpack/conf/jenkins-conf/benchmark/config.yaml
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/config.yaml	(original)
+++ mlpack/conf/jenkins-conf/benchmark/config.yaml	Tue Oct  1 06:49:13 2013
@@ -5,6 +5,8 @@
     timeout: 9000
     database: 'reports/benchmark.db'
     keepReports: 20
+    topChartColor: '#F3F3F3'
+    chartColor: '#FFFFFF'
 ---
 #  MLPACK:
 #  A Scalable C++  Machine Learning Library



More information about the mlpack-svn mailing list