diff options
-rwxr-xr-x | src/daq/flumotion-rrd/flumotion-rrd.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/daq/flumotion-rrd/flumotion-rrd.py b/src/daq/flumotion-rrd/flumotion-rrd.py index a661e31..71d3257 100755 --- a/src/daq/flumotion-rrd/flumotion-rrd.py +++ b/src/daq/flumotion-rrd/flumotion-rrd.py @@ -35,6 +35,7 @@ from twisted.internet import protocol, reactor from socket import error as socket_error import simplejson as json import datetime +import rrdtool _MAX_PACKET_SIZE = 8192 # in bytes @@ -63,7 +64,6 @@ class SFiveProto(protocol.ConnectedDatagramProtocol): self._importer._socketError() - class FlumotionRRD(): """Class to batch import flumotion rrd statistics into the spreadspace streaming statistic suite""" @@ -76,6 +76,8 @@ class FlumotionRRD(): self._format = properties['format'] self._quality = properties['quality'] self._tags = properties['tags'] + self._bytes_rrdfile = properties['bytes-rrdfile'] + self._clients_rrdfile = properties['clients-rrdfile'] self._proto = None self._conn = None @@ -96,14 +98,21 @@ class FlumotionRRD(): def _socketReady(self): print 'SFive: connection to sfive hub established' + self._importRRD() self._sendInit() - # TODO: start data import self._sendDataset(datetime.datetime.utcnow(), 5, 17, 1214, 14214) print 'SFive: sent %d datasets' % (1) reactor.stop() + def _importRRD(self): + print "bytes:\n" + print rrdtool.info(self._bytes_rrdfile) + + print "\n\nclients:\n" + print rrdtool.info(self._clients_rrdfile) + def _sendInit(self): initdata = { "hostname": self._hostname, "streamer-id": { "content-id": self._content_id, "format": self._format, "quality": self._quality }, |