From 6ee0e1c22e204199e8d1b9a40dafb0575c25bea3 Mon Sep 17 00:00:00 2001
From: Rich Prohaska <prohaska@tokutek.com>
Date: Tue, 2 Sep 2014 13:01:56 -0400
Subject: [PATCH 1/3] DB-716 use jemalloc 3.6.0 in tokudb builds

---
 scripts/make.mysql.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/make.mysql.bash b/scripts/make.mysql.bash
index a0e5db48a47..1bf258c5c3b 100755
--- a/scripts/make.mysql.bash
+++ b/scripts/make.mysql.bash
@@ -52,7 +52,7 @@ cmake_build_type=RelWithDebInfo
 mysql_tree=
 tokudbengine_tree=
 ftindex_tree=
-jemalloc_version=3.3.0
+jemalloc_version=3.6.0
 jemalloc_tree=
 backup_tree=
 

From 561edb14e8695814e10a355a71cf53de198b9b79 Mon Sep 17 00:00:00 2001
From: Rich Prohaska <prohaska@tokutek.com>
Date: Tue, 2 Sep 2014 15:44:40 -0400
Subject: [PATCH 2/3] DB-717 add iterations limit to tokustat

---
 scripts/tokustat.py | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/scripts/tokustat.py b/scripts/tokustat.py
index 8e9233e5943..219d3be5368 100755
--- a/scripts/tokustat.py
+++ b/scripts/tokustat.py
@@ -9,10 +9,10 @@ def usage():
     print "diff the tokudb engine status"
     print "--host=HOSTNAME (default: localhost)"
     print "--port=PORT"
-    print "--sleeptime=SLEEPTIME (default: 10 seconds)"
+    print "--interations=MAX_ITERATIONS (default: forever)"
+    print "--interval=TIME_BETWEEN_SAMPLES (default: 10 seconds)"
     print "--q='show engine tokudb status'"
     print "--q='select * from information_schema.global_status'"
-
     return 1
 
 def convert(v):
@@ -23,14 +23,11 @@ def convert(v):
             v = float(v)
     return v
 
-def printit(stats, rs, sleeptime):
-    # print rs
+def printit(stats, rs, interval):
     for t in rs:
         l = len(t) # grab the last 2 fields in t
         k = t[l-2]
         v = t[l-1]
-        # print k, v # debug
-        # try to convert v
         try:
             v = convert(v)
         except:
@@ -41,11 +38,11 @@ def printit(stats, rs, sleeptime):
                 print k, "|", oldv, "|", v,
                 try:
                     d = v - oldv
-                    if sleeptime != 1:
-                        if d >= sleeptime:
-                            e = d / sleeptime
+                    if interval != 1:
+                        if d >= interval:
+                            e = d / interval
                         else:
-                            e = float(d) / sleeptime
+                            e = float(d) / interval
                         print "|", d, "|", e
                     else:
                         print "|", d
@@ -59,7 +56,9 @@ def main():
     port = None
     user = None
     passwd = None
-    sleeptime = 10
+    interval = 10
+    iterations = 0
+
     q = 'show engine tokudb status'
 
     for a in sys.argv[1:]:
@@ -71,6 +70,9 @@ def main():
             continue
         return usage()
 
+    iterations = int(iterations)
+    interval = int(interval)
+
     connect_parameters = {}
     if host is not None:
         if host[0] == '/':
@@ -93,7 +95,9 @@ def main():
     print "connected"
 
     stats = {}
-    while 1:
+    i = 0
+    while iterations == 0 or i <= iterations:
+        i += 1
         try:
             c = db.cursor()
             n = c.execute(q)
@@ -105,8 +109,8 @@ def main():
             return 2
 
         try:
-            printit(stats, rs, int(sleeptime))
-            time.sleep(int(sleeptime))
+            printit(stats, rs, interval)
+            time.sleep(interval)
         except:
             print "printit", sys.exc_info()
             return 3

From ddc9e7488a391e8f1b6a81781b92b1596b5c9da5 Mon Sep 17 00:00:00 2001
From: Rich Prohaska <prohaska@tokutek.com>
Date: Tue, 2 Sep 2014 16:23:32 -0400
Subject: [PATCH 3/3] DB-717 add iterations limit to tokustat

---
 scripts/tokustat.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/tokustat.py b/scripts/tokustat.py
index 219d3be5368..3ecac68e769 100755
--- a/scripts/tokustat.py
+++ b/scripts/tokustat.py
@@ -9,7 +9,7 @@ def usage():
     print "diff the tokudb engine status"
     print "--host=HOSTNAME (default: localhost)"
     print "--port=PORT"
-    print "--interations=MAX_ITERATIONS (default: forever)"
+    print "--iterations=MAX_ITERATIONS (default: forever)"
     print "--interval=TIME_BETWEEN_SAMPLES (default: 10 seconds)"
     print "--q='show engine tokudb status'"
     print "--q='select * from information_schema.global_status'"