diff --git a/bin/ascoltami2 b/bin/ascoltami2 --- a/bin/ascoltami2 +++ b/bin/ascoltami2 @@ -11,9 +11,11 @@ from light9.ascoltami.player import Play from light9.ascoltami.playlist import Playlist, NoSuchSong from light9.ascoltami.webapp import makeWebApp, songUri, songLocation from light9 import networking, showconfig +from standardservice.scalessetup import gatherProcessStats from gi.repository import GObject, Gst +gatherProcessStats() class App(object): diff --git a/bin/collector b/bin/collector --- a/bin/collector +++ b/bin/collector @@ -25,6 +25,7 @@ from greplin.scales.cyclonehandler impor from light9.namespaces import L9 from light9.zmqtransport import parseJsonMessage, startZmq from rdfdb.syncedgraph import SyncedGraph +from standardservice.scalessetup import gatherProcessStats from light9.collector.output import Udmx, DummyOutput # noqa @@ -42,6 +43,7 @@ class Updates(cyclone.websocket.WebSocke json.loads(message) +gatherProcessStats() stats = scales.collection( '/webServer', scales.PmfStat('setAttr', recalcPeriod=1), diff --git a/bin/effecteval b/bin/effecteval --- a/bin/effecteval +++ b/bin/effecteval @@ -16,10 +16,12 @@ from light9.namespaces import L9 from rdfdb.patch import Patch from rdfdb.syncedgraph import SyncedGraph from greplin import scales +from standardservice.scalessetup import gatherProcessStats from cycloneerr import PrettyErrorHandler from light9.coffee import StaticCoffee +gatherProcessStats() class EffectEdit(PrettyErrorHandler, cyclone.web.RequestHandler): diff --git a/bin/vidref b/bin/vidref --- a/bin/vidref +++ b/bin/vidref @@ -30,6 +30,7 @@ from light9 import networking, showconfi from light9.newtypes import Song from light9.vidref import videorecorder from rdfdb.syncedgraph import SyncedGraph +from standardservice.scalessetup import gatherProcessStats parser = optparse.OptionParser() parser.add_option("-v", "--verbose", action="store_true", help="logging.DEBUG") @@ -37,6 +38,7 @@ parser.add_option("-v", "--verbose", act log.setLevel(logging.DEBUG if options.verbose else logging.INFO) +gatherProcessStats() stats = scales.collection( '/webServer', scales.RecentFpsStat('liveWebsocketFrameFps'), diff --git a/light9/effect/sequencer.py b/light9/effect/sequencer.py --- a/light9/effect/sequencer.py +++ b/light9/effect/sequencer.py @@ -20,12 +20,14 @@ from light9.effect.simple_outputs import from light9.namespaces import L9, RDF from light9.newtypes import DeviceUri, DeviceAttr, NoteUri, Curve, Song from rdfdb.syncedgraph import SyncedGraph +from standardservice.scalessetup import gatherProcessStats from greplin import scales import imp log = logging.getLogger('sequencer') +gatherProcessStats() updateStats = scales.collection( '/update/', scales.PmfStat('s0_getMusic', recalcPeriod=1), diff --git a/light9/web/index.html b/light9/web/index.html --- a/light9/web/index.html +++ b/light9/web/index.html @@ -9,6 +9,7 @@
+ diff --git a/light9/web/stats-line.js b/light9/web/stats-line.js --- a/light9/web/stats-line.js +++ b/light9/web/stats-line.js @@ -20,13 +20,12 @@ class StatsLine extends LitElement { const reload = () => { fetch(this.name + '/stats/?format=json').then((resp) => { if (resp.ok) { - resp.json().then((msg) => { - - this.stats = msg; - setTimeout(reload, 1000); + resp.json().then((msg) => { + this.stats = msg; + setTimeout(reload, 1000); + }); + } }); - } - }); } reload(); } @@ -78,10 +77,21 @@ class StatsLine extends LitElement { } render() { + const now = Date.now() / 1000; const table = (d, path) => { - const cols = Object.keys(d); + let cols = Object.keys(d); cols.sort(); + + if (path.length == 0) { + ['webServer', 'process'].forEach((earlyKey) => { + let i = cols.indexOf(earlyKey); + if (i != -1) { + cols = [earlyKey].concat(cols.slice(0, i), cols.slice(i + 1)); + } + }); + } + const th = (col) => { return html`