Passed
Push — master ( 1bf5cf...d6ff14 )
by Dave
02:20
created

tests.func_pushmonitor   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 0
1
'''
2
    A test program that pushes monitoring messages onto the queue
3
    A stress tester for monitoring
4
    when_monitorminer.py should be running to process the messages
5
'''
6
7
from helpers.queuehelper import QueueName, QueueEntries
8
from backend.fcmapp import ApplicationService, ComponentName
9
10
APP = ApplicationService(ComponentName.fullcycle)
11
MINERS = APP.miners()
12
13
CNT = 1
14
while CNT < 2000:
15
    ENTRIES = QueueEntries()
16
    for miner in MINERS:
17
        ENTRIES.add(QueueName.Q_MONITORMINER, APP.messageencode(miner))
18
    APP.enqueue(ENTRIES)
19
    print('sent {} messages'.format(len(ENTRIES.entries)))
20
    CNT += 1
21