From cd9048d861e4625d2be4cf11e541b8d73ae7614d Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 18 Feb 2016 16:18:45 +0100 Subject: [PATCH] validation tx queue, comments --- bigchaindb/block.py | 7 +++++++ bigchaindb/core.py | 2 ++ 2 files changed, 9 insertions(+) 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):