diff options
-rw-r--r-- | doc/TODO | 2 | ||||
-rw-r--r-- | doc/protocol.md | 19 | ||||
-rwxr-xr-x | src/daq/accesslog/s5-accesslog.py | 2 |
3 files changed, 15 insertions, 8 deletions
diff --git a/doc/TODO b/doc/TODO new file mode 100644 index 0000000..6691f01 --- /dev/null +++ b/doc/TODO @@ -0,0 +1,2 @@ +* how to handle NaN values form batch importer like flumotion-rrd? +* should we allow floats for client-count, bytes-sent etc.?
\ No newline at end of file diff --git a/doc/protocol.md b/doc/protocol.md index 3c53a2a..74bdbd2 100644 --- a/doc/protocol.md +++ b/doc/protocol.md @@ -4,8 +4,9 @@ Messages init ---- -The streamer-id and tags are optional. All other fields are mandatory. If the streamer-id -is not defined all data-update messages must contain a streamer-id. +All fields except version are optional. The values in this message are treated as +defaults which will be used if the corresponding value is missing in subsequent +update messages. { "version": 1, @@ -18,15 +19,19 @@ is not defined all data-update messages must contain a streamer-id. data-update ----------- -All elements inside data are optional. The update must contain all data gathered between -start-time and start-time + duration-ms. -If defined by the init message the streamer-id is optional as well and when present it's -values override the values of the init message. +All values which have been defined by the init message are optional. In any case the +values from data updates override values from init. Stateless interfaces will not use +init messages and therefore all values must be defined here. +If an interface (i.e. REST) has other means to detect protocol versions the version +field may be omitted entirely. { + "version": 1, + "hostname": "myhostname", + "streamer-id": { "content-id": "av-orig", "format": "flash", "quality": "medium" }, + "tags": [ "elevate", "2014", "discourse" ] "start-time": "2014-08-03T12:34:56.123Z", "duration-ms": 5000, - "streamer-id": { "content-id": "av-orig", "format": "flash", "quality": "medium" }, "data": { "clients": [ { "ip": "127.0.0.1", "port": 1234, "bytes-sent": 12094, "user-agent": "Mozilla Version 28", .... }, diff --git a/src/daq/accesslog/s5-accesslog.py b/src/daq/accesslog/s5-accesslog.py index 3f8775a..e559041 100755 --- a/src/daq/accesslog/s5-accesslog.py +++ b/src/daq/accesslog/s5-accesslog.py @@ -206,7 +206,7 @@ class AccessLog(): reactor.stop() def _sendInit(self): - initdata = { "hostname": self._hostname, + initdata = { "version": 1, "hostname": self._hostname, "streamer-id": { "content-id": self._content_id, "format": self._format, "quality": self._quality }, "tags": self._tags } self._proto.sendDatagram('%s\n' % (json.dumps(initdata))); |