Browse Source

minor changes to the setup of dropwizard

Patrick Falls 12 years ago
parent
commit
4cee5380b2
3 changed files with 16 additions and 14 deletions
  1. 2 2
      dropwizard/benchmark_config
  2. 5 5
      dropwizard/hello-world.yml
  3. 9 7
      dropwizard/setup.py

+ 2 - 2
dropwizard/benchmark_config

@@ -6,8 +6,8 @@
             "json_url": "/json",
             "db_url": "/db",
             "query_url": "/db?queries=",
-            "port": 9980,
-            "sort": 31
+            "port": 9000,
+            "sort": 69
         }
     }]
 }

+ 5 - 5
dropwizard/hello-world.yml

@@ -1,18 +1,18 @@
 http:
-  port: 9980
+  port: 9000
 
 database:
   # the name of your JDBC driver
   driverClass: com.mysql.jdbc.Driver
 
   # the username
-  user: root
+  user: benchmarkdbuser
 
   # the password
-  password: password
+  password: benchmarkdbpass
 
   # the JDBC URL
-  url: jdbc:mysql://127.0.0.1:3306/hello_world
+  url: jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true
 
   # any properties specific to your JDBC driver:
   properties:
@@ -28,7 +28,7 @@ database:
   minSize: 8
 
   # the maximum number of connections to keep open
-  maxSize: 32
+  maxSize: 256
 
   # whether or not idle connections should be validated
   checkConnectionWhileIdle: false

+ 9 - 7
dropwizard/setup.py

@@ -2,11 +2,12 @@ import subprocess
 import sys
 import setup_util
 from os.path import expanduser
+import os
 
 home = expanduser("~")
 
 def start(args):
-    setup_util.replace_text("dropwizard/hello-world.yml", "url: jdbc:mysql://localhost/hello_world", "url: jdbc:mysql://" + args.database_host + ":3306/hello_world")
+    setup_util.replace_text("dropwizard/hello-world.yml", "url: jdbc:mysql://.*/hello_world", "url: jdbc:mysql://" + args.database_host + ":3306/hello_world")
 
     try:
         subprocess.check_call("mvn clean package;", shell=True, cwd="dropwizard")
@@ -15,9 +16,10 @@ def start(args):
     except subprocess.CalledProcessError:
         return 1
 def stop():
-    try:
-        subprocess.check_call("$RESIN_HOME/bin/resinctl shutdown", shell=True)
-        return 0
-    except subprocess.CalledProcessError:
-        return 1
-
+  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+  out, err = p.communicate()
+  for line in out.splitlines():
+    if 'hello-world' in line:
+      pid = int(line.split(None, 2)[1])
+      os.kill(pid, 9)
+  return 0