# HG changeset patch # User drewp@bigasterisk.com # Date 1580683255 28800 # Node ID 50b95bd96141d47e1edd95d5622e1b919f339bdd # Parent 3f33787bfcb8d8bd46cd18ad63556a6b5e5e0d7d add scales watching time spent in exportToInflux Ignore-this: 6359e703fdc9704081e6731924d2b61c diff -r 3f33787bfcb8 -r 50b95bd96141 lib/export_to_influxdb/export_to_influxdb.py --- a/lib/export_to_influxdb/export_to_influxdb.py Fri Jan 31 23:56:42 2020 -0800 +++ b/lib/export_to_influxdb/export_to_influxdb.py Sun Feb 02 14:40:55 2020 -0800 @@ -2,10 +2,17 @@ from influxdb import InfluxDBClient from rdflib import Namespace from twisted.internet import task +from greplin import scales log = logging.getLogger() ROOM = Namespace('http://projects.bigasterisk.com/room/') +stats = scales.collection( + '/export_to_influxdb', + scales.RecentFpsStat('exportToInflux'), +) + + class RetentionPolicies(object): def __init__(self, influx): self.influx = influx @@ -71,6 +78,7 @@ task.LoopingCall(send).start(period_secs, now=False) + @stats.exportToInflux.time() def exportToInflux(self, currentStatements): """ looks for diff -r 3f33787bfcb8 -r 50b95bd96141 lib/export_to_influxdb/setup.py --- a/lib/export_to_influxdb/setup.py Fri Jan 31 23:56:42 2020 -0800 +++ b/lib/export_to_influxdb/setup.py Sun Feb 02 14:40:55 2020 -0800 @@ -1,12 +1,13 @@ from setuptools import setup - + setup( name='export_to_influxdb', version='0.2.0', packages=['export_to_influxdb'], package_dir={'export_to_influxdb': ''}, install_requires=[ - 'influxdb >= 3.0.0' + 'influxdb >= 3.0.0', + 'scales', ], url='https://projects.bigasterisk.com/export-to-influxdb/export_to_influxdb-0.2.0.tar.gz', author='Drew Perttula',