Changeset - 2c48e92ad5d3
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 3 years ago 2022-05-24 08:21:32
drewp@bigasterisk.com
make loadtest real enough to cause numbers to change on collector's web view
2 files changed with 15 insertions and 11 deletions:
0 comments (0 inline, 0 general)
bin/collector_loadtest.py
Show inline comments
 
#!bin/python
 
import asyncio
 
import logging
 
import random
 
from rdflib import URIRef
 
import time
 
from typing import cast
 

	
 
from light9.collector.collector_client_asyncio import sendToCollector
 
from light9.effect.settings import DeviceSettings
 
@@ -15,7 +16,7 @@ log.setLevel(logging.DEBUG)
 
async def loadTest():
 
    print("scheduling loadtest")
 
    n = 200000
 
    period=1
 
    period=.02
 
    times = []
 
    session = "loadtest%s" % time.time()
 
    for i in range(n):
 
@@ -28,15 +29,15 @@ async def loadTest():
 
            DeviceSettings(
 
                graph=None,
 
                settingsList=[
 
                    [DEV["backlight1"], L9["color"], "#ffffff"],  #
 
                    [DEV["backlight2"], L9["color"], "#ffffff"],
 
                    [DEV["backlight3"], L9["color"], "#ffffff"],
 
                    [DEV["backlight4"], L9["color"], "#ffffff"],
 
                    [DEV["backlight5"], L9["color"], "#ffffff"],
 
                    [DEV["down2"], L9["color"], "#ffffff"],
 
                    [DEV["down3"], L9["color"], "#ffffff"],
 
                    [DEV["down4"], L9["color"], "#ffffff"],
 
                    [DEV["houseSide"], L9["level"], .8],
 
                    # [DEV["backlight1"], L9["color"], "#ffffff"],  #
 
                    # [DEV["backlight2"], L9["color"], "#ffffff"],
 
                    # [DEV["backlight3"], L9["color"], "#ffffff"],
 
                    # [DEV["backlight4"], L9["color"], "#ffffff"],
 
                    # [DEV["backlight5"], L9["color"], "#ffffff"],
 
                    # [DEV["down2"], L9["color"], "#ffffff"],
 
                    # [DEV["down3"], L9["color"], "#ffffff"],
 
                    # [DEV["down4"], L9["color"], "#ffffff"],
 
                    [URIRef('http://light9.bigasterisk.com/theater/skyline/device/down1'), L9["brightness"], random.random()],
 
                    [DEV["backlight5"], L9["uv"], 0.011]
 
                ]))
 
        times.append(time.time() - start)
light9/collector/output.py
Show inline comments
 
@@ -65,6 +65,9 @@ class DummyOutput(Output):
 
    def __init__(self, uri, **kw):
 
        super().__init__(uri)
 

	
 
    def update(self, buf:bytes):
 
        log.info(f'dummy update {list(map(int,buf[:80]))}')
 

	
 

	
 
class BackgroundLoopOutput(Output):
 
    """Call _write forever at 20hz in background threads"""
0 comments (0 inline, 0 general)