Changeset - acdad1f7b75f
[Not reviewed]
default
0 2 0
Drew Perttula - 6 years ago 2019-06-02 11:34:36
drewp@bigasterisk.com
some metrics from asco
Ignore-this: 1df3b55be5136d09e3d7a65c203b4761
2 files changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
light9/ascoltami/player.py
Show inline comments
 
@@ -6,9 +6,13 @@ alternate to the mpd music player, for a
 
import time, logging, traceback
 
from gi.repository import Gst
 
from twisted.internet import task
 
from greplin import scales
 

	
 
log = logging.getLogger()
 

	
 
stats = scales.collection('/player',
 
                          scales.RecentFpsStat('currentTimeFps'),
 
)
 

	
 
class Player(object):
 

	
 
@@ -136,6 +140,7 @@ class Player(object):
 
            log.error("couldn't preload %s, %r", songPath, e)
 
            raise
 

	
 
    @stats.currentTimeFps.rate()
 
    def currentTime(self):
 
        success, cur = self.playbin.query_position(Gst.Format.TIME)
 
        if not success:
light9/ascoltami/webapp.py
Show inline comments
 
@@ -3,6 +3,7 @@ import json, socket, subprocess, os
 
from cyclone import template
 
from rdflib import URIRef
 
import cyclone.web
 
from greplin.scales.cyclonehandler import StatsHandler
 

	
 
from cycloneerr import PrettyErrorHandler
 
from light9.namespaces import L9
 
@@ -166,5 +167,6 @@ def makeWebApp(app):
 
        (r"/seekPlayOrPause", seekPlayOrPause),
 
        (r"/output", output),
 
        (r"/go", goButton),
 
        (r'/stats/(.*)', StatsHandler, {'serverName': 'ascoltami'}),
 
    ],
 
                                   app=app)
0 comments (0 inline, 0 general)