diff --git a/bigchaindb/block.py b/bigchaindb/block.py index ed1257e9..144ebef8 100644 --- a/bigchaindb/block.py +++ b/bigchaindb/block.py @@ -5,10 +5,16 @@ import queue import rethinkdb as r from bigchaindb import Bigchain +from bigchaindb.monitor import Monitor + logger = logging.getLogger(__name__) +# obviously the hostname should come from an environment variable or setting +# http://i.imgur.com/qciaOed.jpg +c = Monitor(host='statsd_1') + class Block(object): @@ -32,6 +38,7 @@ class Block(object): b = Bigchain() while True: + c.gauge('tx_queue_gauge', self.q_tx_to_validate.qsize(), rate=0.01) tx = self.q_new_transaction.get() # poison pill diff --git a/bigchaindb/core.py b/bigchaindb/core.py index 9981eaf2..c5221c26 100644 --- a/bigchaindb/core.py +++ b/bigchaindb/core.py @@ -12,6 +12,8 @@ from bigchaindb import exceptions from bigchaindb.crypto import hash_data, PublicKey, PrivateKey, generate_key_pair from bigchaindb.monitor import Monitor +# obviously the hostname should come from an environment variable or setting + c = Monitor(host='statsd_1') class GenesisBlockAlreadyExistsError(Exception):