summaryrefslogtreecommitdiff
path: root/src/daq/accesslog/sfive-accesslog.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/daq/accesslog/sfive-accesslog.py')
-rwxr-xr-xsrc/daq/accesslog/sfive-accesslog.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/daq/accesslog/sfive-accesslog.py b/src/daq/accesslog/sfive-accesslog.py
index 1914820..89e2c1b 100755
--- a/src/daq/accesslog/sfive-accesslog.py
+++ b/src/daq/accesslog/sfive-accesslog.py
@@ -256,7 +256,7 @@ class AccessLog():
clients.update(linedata)
else:
while linedata['ts'] > nextts:
- self._sendDataset(nextts, self._duration, clients.getCnt(), clients.getBytesSent())
+ self._sendDataset(nextts, self._duration, clients)
cnt += 1
lastts = nextts
nextts = lastts + datetime.timedelta(seconds=self._duration)
@@ -266,7 +266,7 @@ class AccessLog():
# send remaining data
if nextts:
- self._sendDataset(nextts, self._duration, clients.getCnt(), clients.getBytesSent())
+ self._sendDataset(nextts, self._duration, clients)
cnt += 1
except re.error as e:
@@ -274,12 +274,12 @@ class AccessLog():
return cnt
- def _sendDataset(self, timestamp, duration, client_count, bytes_sent):
+ def _sendDataset(self, timestamp, duration, clients):
data = { "start-time": timestamp.isoformat('T'),
"duration-ms": duration * 1000,
"data": {
- "client-count": client_count,
- "bytes-sent": bytes_sent
+ "client-count": clients.getCnt(),
+ "bytes-sent": clients.getBytesSent()
}
}
self._proto.sendDatagram('%s\n' % (json.dumps(data)));