# HG changeset patch # User drewp@bigasterisk.com # Date 2022-05-24 08:21:32 # Node ID 2c48e92ad5d350ec427184ddef13f8b37bf09c49 # Parent 46a8f5a8a4ddf1f0caeb7e879da4a0d3160cec62 make loadtest real enough to cause numbers to change on collector's web view diff --git a/bin/collector_loadtest.py b/bin/collector_loadtest.py --- a/bin/collector_loadtest.py +++ b/bin/collector_loadtest.py @@ -1,8 +1,9 @@ #!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) diff --git a/light9/collector/output.py b/light9/collector/output.py --- a/light9/collector/output.py +++ b/light9/collector/output.py @@ -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"""