STB Drop Statistics protocol

STB can push various statistics data over HTTP request in JSON format.
There could be defined various statistics metrics. Currently supported metricts: network and media.

Statistics is sent to a specified HTTP URL over POST request. URL is set up over provisioning. One request can contain more then one metric report.
Period of statistic send/accumulation is set up over provisioning. After Statistics is first enabled (incl. STB boot), first accumulation period is randomly increased.
Example JSON request:

[
   {
      "type" : "media",
      "timestamp" : 1509629380,
      "url" : "udp://225.100.100.1:1234",
      "id" : "233",
      "proto" : "jsonapi",
      "avg_bitrate" : 1183564,
      "begin" : 1509543180,
      "end" : 1509543268,
      "discontinuties" : 0,
      "video" : {
         "frames_decoded" : 2179,
         "frames_dropped" : 3,
         "frames_failed" : 0
      },
      "audio" : {
         "frames_decoded" : 3690,
         "frames_dropped" : 0,
         "frames_failed" : 0
      },
   },
   {
      "type" : "network",
      "timestamp" : 1509629381,
      "duplex" : "full",
      "gateway" : "192.168.1.1",
      "ip" : "192.168.1.2",
      "name" : "eth0",
      "netmask" : "255.255.255.0",
      "speed" : 100,
      "stat" : {
         "received_bytes" : 778852400,
         "received_discard_packets" : 31,
         "received_error_packets" : 0,
         "received_multicast_packets" : 114356,
         "received_total_packets" : 908433,
         "sent_bytes" : 74131849,
         "sent_error_packets" : 0,
         "sent_total_packets" : 541623
      }
   }
]

Report is organized as a list of report objects. Each object is independent and represents one single measurement of any supported type.

Mandatory fields are:

  • type - string indentifier of metric type. Currently supported: network, media.
  • timestamp - UNIX Timestamp. Time when measurement was actually done.

Other fields are metric specific.

Metrics

Media

This measurement is done each time media is STOPPING playback. So, it collects data of a single playback session.

    {
      "type" : "media",
      "timestamp" : 1509543268,
      "url" : "udp://225.100.100.1:1234",
      "avg_bitrate" : 1183564,
      "begin" : 1509543180,
      "end" : 1509543268,
      "discontinuties" : 0,
      "id" : "233",
      "proto" : "jsonapi",
      "video" : {
         "frames_decoded" : 2179,
         "frames_dropped" : 3,
         "frames_failed" : 0
      },
      "audio" : {
         "frames_decoded" : 3690,
         "frames_dropped" : 0,
         "frames_failed" : 0
      },
   }
FieldTypeDescription
url String URL of played media.
protoString TVIP TV protocol name, which started stream, if known.
idStringID of content inside protocol, if known.
avg_bitrate Int Average bitrate of stream.
begin IntUNIX Timestamp of playback start.
end IntUNIX Timestamp of playback end.
discontinuties IntFor MPEGTS streams (and some HLS stream), number of TS discontinuties.
frames_decodedIntTotal number of decoded video/audio frames.
frames_droppedIntTotal number of dropped video/audio frames.
frames_failedIntTotal umber of frame decode errors.
Network

Network measurement is done in periods defined by provisioning. Statistics is sent for each active (running) interface.
Example:

    {
      "type" : "network",
      "timestamp" : 1509629381,
      "name" : "eth0",
      "speed" : 100,
      "duplex" : "full",
      "ip" : "192.168.1.2",
      "netmask" : "255.255.255.0",
      "gateway" : "192.168.1.1",
      "stat" : {
         "received_bytes" : 778852400,
         "received_discard_packets" : 31,
         "received_error_packets" : 0,
         "received_multicast_packets" : 114356,
         "received_total_packets" : 908433,
         "sent_bytes" : 74131849,
         "sent_error_packets" : 0,
         "sent_total_packets" : 541623
      }
FieldTypeDescription
nameStringLinux network interface name.
speedIntCurrent link connection speed in megabits.
duplexStringCurrent link duplex(full/half).
ipStringInterface IPv4 address.
netmaskStringInterface IPv4 netmask.
gatewayStringCurrent active gateway.
received_bytesIntTotal number of bytes received over interface.
received_total_packetsIntTotal number of packets received over interface.
received_multicast_packetsIntTotal number of multicast packets received over interface.
received_error_packetsIntTotal number of receive errors on interface.
received_discard_packetsIntTotal number of discarded input packets.
sent_bytesIntTotal number of bytes sent over interface.
sent_total_packetsIntTotal number of packets sent over interface.
sent_error_packetsIntTotal number of send errors.

Translations of this page: