Browse Source

Add method to get list of frameworks, take out list of frameworks. Add output of commit_count to results.json under rawData.commitCounts

haleyyoung 12 years ago
parent
commit
22691d2faa

+ 51 - 106
benchmarker.py

@@ -26,9 +26,6 @@ class Benchmarker:
 
 
     for test in all_tests:
     for test in all_tests:
       print str(test.sort) + ": " + test.name
       print str(test.sort) + ": " + test.name
-
-    self.__finish()
-
   ############################################################
   ############################################################
   # End run_list_tests
   # End run_list_tests
   ############################################################
   ############################################################
@@ -232,6 +229,45 @@ class Benchmarker:
   # End __gather_tests
   # End __gather_tests
   ############################################################
   ############################################################
 
 
+  ############################################################
+  # Gathers all the frameworks
+  ############################################################
+  def __gather_frameworks(self):
+    frameworks = []
+    # Loop through each directory (we assume we're being run from the benchmarking root)
+    for dirname, dirnames, filenames in os.walk('.'):
+      # Look for the benchmark_config file, this will contain our framework name
+      # It's format looks like this:
+      #
+      # {
+      #   "framework": "nodejs",
+      #   "tests": [{
+      #     "default": {
+      #       "setup_file": "setup",
+      #       "json_url": "/json"
+      #     },
+      #     "mysql": {
+      #       "setup_file": "setup",
+      #       "db_url": "/mysql",
+      #       "query_url": "/mysql?queries="
+      #     },
+      #     ...
+      #   }]
+      # }
+      if 'benchmark_config' in filenames:
+        config = None
+        with open(os.path.join(dirname, 'benchmark_config'), 'r') as config_file:
+          # Load json file into config object
+          config = json.load(config_file)
+        if config == None:
+          continue
+        frameworks.append(str(config['framework']))
+
+    return frameworks
+  ############################################################
+  # End __gather_frameworks
+  ############################################################
+
   ############################################################
   ############################################################
   # Makes any necessary changes to the server that should be 
   # Makes any necessary changes to the server that should be 
   # made before running the tests. This involves setting kernal
   # made before running the tests. This involves setting kernal
@@ -392,16 +428,14 @@ class Benchmarker:
   # are needed.
   # are needed.
   ############################################################
   ############################################################
   def __parse_results(self, tests):
   def __parse_results(self, tests):
+    # Run the method to get the commmit count of each framework.
+    self.__count_commits()
+
     # Time to create parsed files
     # Time to create parsed files
     # Aggregate JSON file
     # Aggregate JSON file
     with open(os.path.join(self.full_results_directory(), "results.json"), "w") as f:
     with open(os.path.join(self.full_results_directory(), "results.json"), "w") as f:
       f.write(json.dumps(self.results))
       f.write(json.dumps(self.results))
 
 
-    # Run the method to get the commmit count of each framework.
-    self.__count_commits()
-
-    with open(os.path.join(self.full_results_directory(), "commits.json"), "w") as f:
-      f.write(json.dumps(self.commits))
     
     
     # JSON CSV
     # JSON CSV
     # with open(os.path.join(self.full_results_directory(), "json.csv"), 'wb') as csvfile:
     # with open(os.path.join(self.full_results_directory(), "json.csv"), 'wb') as csvfile:
@@ -444,108 +478,19 @@ class Benchmarker:
   # __count_commits
   # __count_commits
   ############################################################
   ############################################################
   def __count_commits(self):
   def __count_commits(self):
-    all_folders = [
-      "aspnet",
-      "aspnet-stripped",
-      "beego",
-      "bottle",
-      "cake",
-      "compojure",
-      "cowboy",
-      "cpoll_cppsp",
-      "dancer",
-      "dart",
-      "django",
-      "django-stripped",
-      "dropwizard",
-      "elli",
-      "express",
-      "finagle",
-      "flask",
-      "gemini",
-      "go",
-      "grails",
-      "grizzly-bm",
-      "grizzly-jersey",
-      "hapi",
-      "http-kit",
-      "HttpListener",
-      "jester",
-      "kelp",
-      "lapis",
-      "lift-stateless",
-      "luminus",
-      "mojolicious",
-      "nancy",
-      "netty",
-      "nodejs",
-      "onion",
-      "openresty",
-      "php",
-      "php-codeigniter",
-      "php-fuel",
-      "php-kohana",
-      "php-laravel",
-      "php-lithium",
-      "php-micromvc",
-      "php-phalcon",
-      "php-phalcon-micro",
-      "php-silex",
-      "php-silex-orm",
-      "php-silica",
-      "php-slim",
-      "php-symfony2",
-      "php-yaf",
-      "phreeze",
-      "plack",
-      "plain",
-      "play1",
-      "play1siena",
-      "play-java",
-      "play-java-jpa",
-      "play-scala",
-      "play-scala-mongodb",
-      "play-slick",
-      "rack",
-      "rails",
-      "rails-stripped",
-      "restexpress",
-      "revel",
-      "revel-jet",
-      "revel-qbs",
-      "ringojs",
-      "ringojs-convenient",
-      "scalatra",
-      "servicestack",
-      "servlet",
-      "sinatra",
-      "snap",
-      "spark",
-      "spray",
-      "spring",
-      "tapestry",
-      "tornado",
-      "treefrog",
-      "undertow",
-      "unfiltered",
-      "vertx",
-      "wai",
-      "webgo",
-      "web-simple",
-      "wicket",
-      "wsgi",
-      "yesod"
-    ]
-
-    jsonResult = {"commitCount":{}}
-
-    for framework in all_folders:
+    all_frameworks = self.__gather_frameworks()
+
+    jsonResult = {}
+
+    for framework in all_frameworks:
       try:
       try:
-        command = "echo $(git rev-list --count HEAD -- " + framework + ")"
+        command = "git rev-list HEAD -- " + framework + " | sort -u | wc -l"
         commitCount = subprocess.check_output(command, shell=True)
         commitCount = subprocess.check_output(command, shell=True)
-        jsonResult["commitCount"][framework] = int(commitCount)
+        jsonResult[framework] = int(commitCount)
       except:
       except:
         continue
         continue
+
+    self.results['rawData']['commitCounts'] = jsonResult
     self.commits = jsonResult
     self.commits = jsonResult
   ############################################################
   ############################################################
   # End __count_commits
   # End __count_commits

+ 2 - 2
cake/deploy/cake

@@ -1,6 +1,6 @@
 <VirtualHost *:8080>
 <VirtualHost *:8080>
-  Alias /cake/ "/home/ubuntu/FrameworkBenchmarks/cake/app/webroot/"
-  <Directory /home/ubuntu/FrameworkBenchmarks/cake/app/webroot/>
+  Alias /cake/ "/home/hyoung/FrameworkBenchmarks/cake/app/webroot/"
+  <Directory /home/hyoung/FrameworkBenchmarks/cake/app/webroot/>
           Options Indexes FollowSymLinks MultiViews
           Options Indexes FollowSymLinks MultiViews
           #AllowOverride None
           #AllowOverride None
           Order allow,deny
           Order allow,deny

+ 1 - 1
cake/deploy/nginx.conf

@@ -59,7 +59,7 @@ http {
         #    proxy_pass   http://127.0.0.1;
         #    proxy_pass   http://127.0.0.1;
         #}
         #}
         
         
-        root /home/ubuntu/FrameworkBenchmarks/cake/app/webroot/;
+        root /home/hyoung/FrameworkBenchmarks/cake/app/webroot/;
         index  index.php;
         index  index.php;
 
 
         location / {
         location / {

+ 2 - 2
django/hello/hello/settings.py

@@ -15,7 +15,7 @@ DATABASES = {
         'NAME': 'hello_world',                      # Or path to database file if using sqlite3.
         'NAME': 'hello_world',                      # Or path to database file if using sqlite3.
         'USER': 'benchmarkdbuser',                      # Not used with sqlite3.
         'USER': 'benchmarkdbuser',                      # Not used with sqlite3.
         'PASSWORD': 'benchmarkdbpass',                  # Not used with sqlite3.
         'PASSWORD': 'benchmarkdbpass',                  # Not used with sqlite3.
-        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
+        'HOST': 'localhost',                      # Set to empty string for localhost. Not used with sqlite3.
         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
         'CONN_MAX_AGE': 30,
         'CONN_MAX_AGE': 30,
     }
     }
@@ -109,7 +109,7 @@ TEMPLATE_DIRS = (
     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
     # Always use forward slashes, even on Windows.
     # Always use forward slashes, even on Windows.
     # Don't forget to use absolute paths, not relative paths.
     # Don't forget to use absolute paths, not relative paths.
-    "/home/ubuntu/FrameworkBenchmarks/django/hello/templates",
+    "/home/hyoung/FrameworkBenchmarks/django/hello/templates",
 )
 )
 
 
 INSTALLED_APPS = (
 INSTALLED_APPS = (

+ 1 - 1
gemini/Docroot/WEB-INF/resin.xml

@@ -14,7 +14,7 @@
     </server>
     </server>
 
 
     <host>
     <host>
-      <web-app id="/" root-directory="/home/ubuntu/FrameworkBenchmarks/gemini/Docroot" />
+      <web-app id="/" root-directory="/home/hyoung/FrameworkBenchmarks/gemini/Docroot" />
     </host>
     </host>
 
 
   </cluster>
   </cluster>

+ 1 - 1
php/deploy/nginx.conf

@@ -67,7 +67,7 @@ http {
         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
         #
         #
         location ~ \.php$ {
         location ~ \.php$ {
-            root /home/pfalls/FrameworkBenchmarks/php;
+            root /home/hyoung/FrameworkBenchmarks/php;
             fastcgi_pass   fastcgi_backend;
             fastcgi_pass   fastcgi_backend;
 #            fastcgi_pass 127.0.0.1:9001;
 #            fastcgi_pass 127.0.0.1:9001;
             fastcgi_index  index.php;
             fastcgi_index  index.php;

+ 2 - 2
php/deploy/php

@@ -1,6 +1,6 @@
 <VirtualHost *:8080>
 <VirtualHost *:8080>
-  Alias /php/ "/home/pfalls/FrameworkBenchmarks/php/"
-  <Directory /home/pfalls/FrameworkBenchmarks/php/>
+  Alias /php/ "/home/hyoung/FrameworkBenchmarks/php/"
+  <Directory /home/hyoung/FrameworkBenchmarks/php/>
           Options Indexes FollowSymLinks MultiViews
           Options Indexes FollowSymLinks MultiViews
           #AllowOverride None
           #AllowOverride None
           Order allow,deny
           Order allow,deny