summaryrefslogtreecommitdiff
path: root/src/daq/flumotion-rrd/s5-flumotion-rrd.py
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-10-16 22:58:42 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-10-16 22:58:42 +0200
commit4cdb1c8cd8817bae3a2fe509fabad162c62e82af (patch)
treec622f7b0ed462270ec6b1265db3e8e669ebd316c /src/daq/flumotion-rrd/s5-flumotion-rrd.py
parentadded prepare script for go get (diff)
added 'Z' after each timestamp to state it's UTC
flumotion-rrd now rounds client_cnt and bytes_sent and imports them as integers
Diffstat (limited to 'src/daq/flumotion-rrd/s5-flumotion-rrd.py')
-rwxr-xr-xsrc/daq/flumotion-rrd/s5-flumotion-rrd.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/daq/flumotion-rrd/s5-flumotion-rrd.py b/src/daq/flumotion-rrd/s5-flumotion-rrd.py
index 4b0a2d1..6809d20 100755
--- a/src/daq/flumotion-rrd/s5-flumotion-rrd.py
+++ b/src/daq/flumotion-rrd/s5-flumotion-rrd.py
@@ -135,7 +135,7 @@ class FlumotionRRD():
return False
print 'SFive: will use 7 days of data ending with %s using a step size of %d seconds' % (
- datetime.datetime.utcfromtimestamp(self._end).isoformat('T'), self._duration)
+ datetime.datetime.utcfromtimestamp(self._end).isoformat('T') + 'Z', self._duration)
except rrdtool.error as e:
print 'SFive: rrdtool-error: %s' % (e)
@@ -194,7 +194,9 @@ class FlumotionRRD():
return cnt
def _sendDataset(self, timestamp, duration, client_count, bytes_sent):
- data = { "start-time": timestamp.isoformat('T'),
+ client_count = int(round(client_count)) if client_count else 0
+ bytes_sent = int(round(bytes_sent)) if bytes_sent else 0
+ data = { "start-time": timestamp.isoformat('T') + 'Z',
"duration-ms": duration * 1000,
"data": {
"client-count": client_count,