Mercurial > code > home > repos > homeauto
changeset 698:50b95bd96141
add scales watching time spent in exportToInflux
Ignore-this: 6359e703fdc9704081e6731924d2b61c
author | drewp@bigasterisk.com |
---|---|
date | Sun, 02 Feb 2020 14:40:55 -0800 |
parents | 3f33787bfcb8 |
children | 17fa56851491 |
files | lib/export_to_influxdb/export_to_influxdb.py lib/export_to_influxdb/setup.py |
diffstat | 2 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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',