summaryrefslogtreecommitdiff
path: root/src/daq/flumotion-rrd
diff options
context:
space:
mode:
Diffstat (limited to 'src/daq/flumotion-rrd')
-rwxr-xr-xsrc/daq/flumotion-rrd/flumotion-rrd.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/daq/flumotion-rrd/flumotion-rrd.py b/src/daq/flumotion-rrd/flumotion-rrd.py
index bd16a66..7306074 100755
--- a/src/daq/flumotion-rrd/flumotion-rrd.py
+++ b/src/daq/flumotion-rrd/flumotion-rrd.py
@@ -77,7 +77,6 @@ class FlumotionRRD():
self._format = properties['format']
self._quality = properties['quality']
self._tags = properties['tags']
- self._duration = properties['duration']
self._proto = None
self._conn = None
@@ -101,7 +100,7 @@ class FlumotionRRD():
self._sendInit()
# TODO: start data import
- self._sendDataset(17, 1214, 14214)
+ self._sendDataset(datetime.datetime.utcnow(), 5, 17, 1214, 14214)
print 'SFive: sent %d datasets' % (1)
reactor.stop()
@@ -112,9 +111,9 @@ class FlumotionRRD():
"tags": self._tags }
self._proto.sendDatagram('%s\n' % (json.dumps(initdata)));
- def _sendDataset(self, client_count, bytes_received, bytes_sent):
- data = { "start-time": datetime.datetime.utcnow().isoformat('Z'),
- "duration-ms": self._duration,
+ def _sendDataset(self, timestamp, duration, client_count, bytes_received, bytes_sent):
+ data = { "start-time": timestamp.isoformat('Z'),
+ "duration-ms": duration * 1000,
"data": {
"client-count": client_count,
"bytes-received": bytes_received,
@@ -132,7 +131,6 @@ if __name__ == '__main__':
'format': 'webm',
'quality': 'high',
'tags': [ 'elevate', '2013' ],
- 'duration': 5000,
'bytes-rrdfile': '/tmp/av-webm-high_bytes.rrd',
'clients-rrdfile': '/tmp/av-webm-high_clients.rrd',
})