Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

usability improvements

  • Loading branch information...
commit 4fe15ab25e7dedaea47aba99332feac408b055dd 1 parent 94a4f55
@deafgoat deafgoat authored
Showing with 22 additions and 20 deletions.
  1. +1 −1  SConstruct
  2. +1 −1  main.tpl
  3. +10 −11 mongomgr.py
  4. +5 −2 runner.py
  5. +5 −5 server.py
View
2  SConstruct
@@ -34,4 +34,4 @@ for x in libs:
env = conf.Finish()
-env.Program( "benchmark" , ["benchmark.cpp"] )
+env.Program(["benchmark.cpp"] )
View
2  main.tpl
@@ -68,7 +68,7 @@
<input type="checkbox" name="versions" value={{version}}>{{version}}<br>
%end
<h2>Limit</h2>
- <input type="text" name="limit" size="2" value="5"/><br>
+ <input type="text" name="limit" size="2" value="5"/><br><br>
<button action='submit'>Submit</button>
</form>
View
21 mongomgr.py
@@ -5,7 +5,7 @@
import socket
class mongod(object):
- def __init__(self, mongod="./mongod", port=27017, **kwargs):
+ def __init__(self, mongod="mongod", port=27017, **kwargs):
self.kwargs = kwargs
self.proc = None
self.mongod = mongod
@@ -39,12 +39,11 @@ def start(self):
raise Exception("no mongod found in this directory.")
path = "/data/db"
- if os.sys.platform == "win32":
- path = "C:\data\db"
- argv = ["mkdir", "-p", path]
- subprocess.Popen(argv).communicate()
- argv = [self.mongod, "--fork", "--syslog", "--port", self.port]
+ mkdir = ["mkdir", "-p", path]
+ subprocess.Popen(mkdir).communicate()
+
+ argv = [self.mongod, "--port", self.port]
print "running " + " ".join(argv)
self.proc = self._start(argv)
@@ -60,7 +59,7 @@ def _start(self, argv):
"""
proc = subprocess.Popen(argv)
- if os.sys.platform == "win32":
+ if os.sys.platform.startswith( "win" ):
# Create a job object with the "kill on job close"
# flag; this is inherited by child processes (ie
# the mongod started on our behalf by buildlogger)
@@ -95,12 +94,11 @@ def stop(self):
# Windows doesn't seem to kill the process immediately, so give it some time to die
time.sleep(5)
else:
- # This actually works
- mongo_executable = os.path.abspath(os.path.join(self.mongod, '..', 'mongo'))
- argv = [mongo_executable, "--port", self.port, "--eval", "db.getSiblingDB('admin').shutdownServer()"]
- proc = subprocess.Popen(argv)
# This function not available in Python 2.5
self.proc.terminate()
+ # The above didn't work on Mac OS X
+ # argv = [self.mongod, "--port", self.port, "--eval", "db.getSiblingDB('admin').shutdownServer()"]
+ # proc = subprocess.Popen(argv)
except AttributeError:
from os import kill
kill(self.proc.pid, 15)
@@ -110,3 +108,4 @@ def stop(self):
self.proc.wait()
sys.stderr.flush()
+ sys.stdout.flush()
View
7 runner.py
@@ -43,7 +43,10 @@
# start mongod
mongod_handle = mongod(mongod=opts.mongod, port=opts.port)
mongod_handle.start()
- benchmark = subprocess.Popen(['./benchmark', opts.port, opts.iterations, multidb, opts.username, opts.password], stdout=subprocess.PIPE)
+ benchmark_cmd = './benchmark'
+ if os.sys.platform.startswith( "win" ):
+ benchmark_cmd = "benchmark.exe"
+ benchmark = subprocess.Popen([benchmark_cmd, opts.port, opts.iterations, multidb, opts.username, opts.password], stdout=subprocess.PIPE)
benchmark_results = benchmark.communicate()[0]
time.sleep(1) # wait for server to clean up connections
except:
@@ -93,7 +96,7 @@
obj = json.loads(line, object_hook=object_hook)
obj['run_date'] = run_date
obj['label'] = opts.label
- obj['platform'] = testbed_info['os']['name']
+ obj['platform'] = testbed_info['os']['name'].replace(" ", "_")
obj['commit'] = build_info['gitVersion']
obj['version'] = build_info['version']
obj['run_date'] = run_date
View
10 server.py
@@ -45,7 +45,7 @@ def raw_data(versions, labels, dates, platforms, start, end, limit):
if versions:
if versions.startswith('/') and versions.endswith('/'):
- version_query = {'version': {'$regex': versions[1:-1]}}
+ version_query = {'version': {'$regex': versions[1:-1], '$options' : 'i'}}
else:
version_query = {'version': {'$in': versions.split(" ")}}
else:
@@ -53,7 +53,7 @@ def raw_data(versions, labels, dates, platforms, start, end, limit):
if platforms:
if platforms.startswith('/') and platforms.endswith('/'):
- platforms_query = {'platform': {'$regex': platforms[1:-1]}}
+ platforms_query = {'platform': {'$regex': platforms[1:-1], '$options' : 'i'}}
else:
platforms_query = {'platform': {'$in': platforms.split(" ")}}
else:
@@ -61,7 +61,7 @@ def raw_data(versions, labels, dates, platforms, start, end, limit):
if dates:
if dates.startswith('/') and dates.endswith('/'):
- date_query = {'run_date': {'$regex': dates[1:-1]}}
+ date_query = {'run_date': {'$regex': dates[1:-1], '$options' : 'i'}}
else:
date_query = {'run_date': {'$in': dates.split(" ")}}
else:
@@ -69,7 +69,7 @@ def raw_data(versions, labels, dates, platforms, start, end, limit):
if labels:
if labels.startswith('/') and labels.endswith('/'):
- label_query = {'label': {'$regex': labels[1:-1]}}
+ label_query = {'label': {'$regex': labels[1:-1], '$options' : 'i'}}
else:
label_query = {'label': {'$in': labels.split(" ")}}
else:
@@ -143,7 +143,7 @@ def main_page():
# db.info.distinct("platform.os.name")
platforms = db.raw.distinct("platform")
num_tests = len(db.raw.distinct("name"))
- num_labels = len(db.raw.distinct("labels"))
+ num_labels = len(db.raw.distinct("label"))
rows = None
versions = sorted(db.info.distinct("build_info.version"), reverse=True)
if versions:
Please sign in to comment.
Something went wrong with that request. Please try again.