| Total Complexity | 0 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 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 |