|
@@ -26,9 +26,6 @@ class Benchmarker:
|
|
|
|
|
|
for test in all_tests:
|
|
|
print str(test.sort) + ": " + test.name
|
|
|
-
|
|
|
- self.__finish()
|
|
|
-
|
|
|
############################################################
|
|
|
# End run_list_tests
|
|
|
############################################################
|
|
@@ -232,6 +229,45 @@ class Benchmarker:
|
|
|
# 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
|
|
|
# made before running the tests. This involves setting kernal
|
|
@@ -392,16 +428,14 @@ class Benchmarker:
|
|
|
# are needed.
|
|
|
############################################################
|
|
|
def __parse_results(self, tests):
|
|
|
+ # Run the method to get the commmit count of each framework.
|
|
|
+ self.__count_commits()
|
|
|
+
|
|
|
# Time to create parsed files
|
|
|
# Aggregate JSON file
|
|
|
with open(os.path.join(self.full_results_directory(), "results.json"), "w") as f:
|
|
|
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
|
|
|
# with open(os.path.join(self.full_results_directory(), "json.csv"), 'wb') as csvfile:
|
|
@@ -444,108 +478,19 @@ class Benchmarker:
|
|
|
# __count_commits
|
|
|
############################################################
|
|
|
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:
|
|
|
- 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)
|
|
|
- jsonResult["commitCount"][framework] = int(commitCount)
|
|
|
+ jsonResult[framework] = int(commitCount)
|
|
|
except:
|
|
|
continue
|
|
|
+
|
|
|
+ self.results['rawData']['commitCounts'] = jsonResult
|
|
|
self.commits = jsonResult
|
|
|
############################################################
|
|
|
# End __count_commits
|