validation tx queue, comments

This commit is contained in:
ryan 2016-02-18 16:18:45 +01:00
parent b9279431cd
commit cd9048d861
2 changed files with 9 additions and 0 deletions

View File

@ -5,10 +5,16 @@ import queue
import rethinkdb as r import rethinkdb as r
from bigchaindb import Bigchain from bigchaindb import Bigchain
from bigchaindb.monitor import Monitor
logger = logging.getLogger(__name__) 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): class Block(object):
@ -32,6 +38,7 @@ class Block(object):
b = Bigchain() b = Bigchain()
while True: while True:
c.gauge('tx_queue_gauge', self.q_tx_to_validate.qsize(), rate=0.01)
tx = self.q_new_transaction.get() tx = self.q_new_transaction.get()
# poison pill # poison pill

View File

@ -12,6 +12,8 @@ from bigchaindb import exceptions
from bigchaindb.crypto import hash_data, PublicKey, PrivateKey, generate_key_pair from bigchaindb.crypto import hash_data, PublicKey, PrivateKey, generate_key_pair
from bigchaindb.monitor import Monitor from bigchaindb.monitor import Monitor
# obviously the hostname should come from an environment variable or setting
c = Monitor(host='statsd_1') c = Monitor(host='statsd_1')
class GenesisBlockAlreadyExistsError(Exception): class GenesisBlockAlreadyExistsError(Exception):