summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/tools
diff options
context:
space:
mode:
authorMatt Kangas <matt.kangas@mongodb.com>2014-11-10 08:52:26 -0500
committerMatt Kangas <matt.kangas@mongodb.com>2014-11-10 08:52:26 -0500
commitaed9203f383619406705119cdf62c6f28c33c4e0 (patch)
tree785d1c7a4e7a5304fcbfb1b9af6cbc8ac8621f63 /src/third_party/wiredtiger/tools
parent20ad93b09352b317302f6b713bacaedab757c93b (diff)
downloadmongo-aed9203f383619406705119cdf62c6f28c33c4e0.tar.gz
Import wiredtiger-wiredtiger-2.4.0-285-g0d497d3.tar.gz from wiredtiger branch develop
Diffstat (limited to 'src/third_party/wiredtiger/tools')
-rw-r--r--src/third_party/wiredtiger/tools/wt_nvd3_util.py13
-rw-r--r--src/third_party/wiredtiger/tools/wtperf_stats.py5
-rw-r--r--src/third_party/wiredtiger/tools/wtstats.py13
3 files changed, 28 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/tools/wt_nvd3_util.py b/src/third_party/wiredtiger/tools/wt_nvd3_util.py
index 6bf1396b0ff..87ce9b85e9f 100644
--- a/src/third_party/wiredtiger/tools/wt_nvd3_util.py
+++ b/src/third_party/wiredtiger/tools/wt_nvd3_util.py
@@ -25,8 +25,19 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
+import os, sys
from datetime import datetime
-from nvd3 import lineChart
+
+tool_dir = os.path.split(sys.argv[0])[0]
+# Make sure Python finds the NVD3 in our third party directory, to
+# avoid compatability issues
+sys.path.append(os.path.join(tool_dir, "third_party"))
+
+try:
+ from nvd3 import lineChart
+except ImportError:
+ print >>sys.stderr, "Could not import nvd3. It should be installed locally."
+ sys.exit(-1)
# Add a multiChart type so we can overlay line graphs
class multiChart(lineChart):
diff --git a/src/third_party/wiredtiger/tools/wtperf_stats.py b/src/third_party/wiredtiger/tools/wtperf_stats.py
index 6f2f6dda682..f87ca2d3254 100644
--- a/src/third_party/wiredtiger/tools/wtperf_stats.py
+++ b/src/third_party/wiredtiger/tools/wtperf_stats.py
@@ -26,9 +26,12 @@
# OTHER DEALINGS IN THE SOFTWARE.
#
-import os, csv, operator
+import os, csv, operator, sys
from time import mktime
+tool_dir = os.path.split(sys.argv[0])[0]
+sys.path.append(tool_dir)
+
try:
from wt_nvd3_util import multiChart, parsetime
except ImportError:
diff --git a/src/third_party/wiredtiger/tools/wtstats.py b/src/third_party/wiredtiger/tools/wtstats.py
index 371af6b4f1a..7950fd69081 100644
--- a/src/third_party/wiredtiger/tools/wtstats.py
+++ b/src/third_party/wiredtiger/tools/wtstats.py
@@ -31,6 +31,13 @@ from collections import defaultdict
from time import mktime
from subprocess import call
+# Make sure Python can find files in the tools directory
+tool_dir = os.path.split(sys.argv[0])[0]
+sys.path.append(tool_dir)
+# Make sure Python finds the NVD3 in our third party directory, to
+# avoid compatability issues
+sys.path.append(os.path.join(tool_dir, "third_party"))
+
try:
from stat_data import no_scale_per_second_list, no_clear_list
except ImportError:
@@ -55,7 +62,11 @@ except ImportError:
try:
from nvd3 import lineChart, lineWithFocusChart
except ImportError:
- print >>sys.stderr, "Could not import nvd3. Please install it *from source* (other versions may be missing features that we rely on). Run these commands: git clone https://github.com/areski/python-nvd3.git ; cd python-nvd3 ; sudo python setup.py install"
+ print >>sys.stderr, "Could not import nvd3 it should be installed locally"
+ sys.exit(-1)
+
+if sys.version_info<(2,7,0):
+ print >>sys.stderr, "You need python 2.7 or later to run this script"
sys.exit(-1)
# Plot a set of entries for a title.