Skip to content

Instantly share code, notes, and snippets.

View dhaikney's full-sized avatar

David Haikney dhaikney

  • Couchbase
  • Manchester
View GitHub Profile
@dhaikney
dhaikney / cb_monitor.py
Created February 24, 2015 11:59
Basic python script to show how Couchbase's stats REST endpoint can be used to garner statistics over time
#!/usr/bin/env python
# Initial version - 24-Feb 2015
# Monitor interesting Couchbase statistics over a period of time
# Stats are captured via calling the REST endpoint which provides individual
# stats for each node. These are then post-processed to provide cluster-wide
# totals before being output to the console.
import json
from collections import defaultdict
import sys
#!/usr/bin/env - python
from couchbase.bucket import Bucket
import threading
import sys
from multiprocessing.dummy import Pool as ThreadPool
TIMEOUT=10
if len(sys.argv) != 7:
print "Usage: " + sys.argv[0] + " <host> <bucket> <count> <size> <conns> <threads>"