forked from TechEmpower/FrameworkBenchmarks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created benchmark_config and setup.py files for dancer
- Loading branch information
1 parent
9bdd43e
commit d44a6a8
Showing
6 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"framework": "dancer", | ||
"tests": [{ | ||
"default": { | ||
"setup_file": "setup", | ||
"json_url": "/json", | ||
"port": 8080, | ||
"sort": 76 | ||
}, | ||
"raw": { | ||
"setup_file": "setup", | ||
"db_url": "/db", | ||
"query_url": "/db?queries=", | ||
"port": 8080, | ||
"sort": 77 | ||
} | ||
}] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import subprocess | ||
import sys | ||
import setup_util | ||
from os.path import expanduser | ||
import os | ||
import getpass | ||
|
||
home = expanduser("~") | ||
|
||
def start(args): | ||
setup_util.replace_text("dancer/app.pl", "localhost", ""+ args.database_host +"") | ||
setup_util.replace_text("dancer/nginx.conf", "USR", getpass.getuser()) | ||
|
||
try: | ||
subprocess.Popen("plackup -E production -s Starman --workers=2 -l " + home + "/FrameworkBenchmarks/dancer/frameworks-benchmark.sock -a ./app.pl", shell=True, cwd="dancer") | ||
subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/dancer/nginx.conf", shell=True) | ||
return 0 | ||
except subprocess.CalledProcessError: | ||
return 1 | ||
def stop(): | ||
try: | ||
subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True) | ||
p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE) | ||
out, err = p.communicate() | ||
for line in out.splitlines(): | ||
if 'plackup' in line: | ||
pid = int(line.split(None, 2)[1]) | ||
os.kill(pid, 9) | ||
return 0 | ||
except subprocess.CalledProcessError: | ||
return 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters