restreamer icon indicating copy to clipboard operation
restreamer copied to clipboard

Can't obtain sessions info from API

Open sincar74 opened this issue 1 year ago • 1 comments

I all, this is my first post, and I want to thank you all for this amazing project

Subject of the issue I'm trying to get session information from API /api/v3/session, what I'm expecting is the number of current viewers connected to each channel, bandwidth tx, ..., but I always receive from API an all zero result:

{
  "": {
    "active": {
      "list": [],
      "sessions": 0,
      "bandwidth_rx_mbit": 0,
      "bandwidth_tx_mbit": 0,
      "max_sessions": 0,
      "max_bandwidth_rx_mbit": 0,
      "max_bandwidth_tx_mbit": 0
    },
    "summary": {
      "remote": {},
      "local": {},
      "reference": {},
      "sessions": 0,
      "traffic_rx_mb": 0,
      "traffic_tx_mb": 0
    }
  }
}

I'm honest, I didn't understand the meaning of the "collectors" parameter

Environment

  • Ubuntu 20.04.6 LTS
  • Docker version 24.0.7, build afdd53b
  • docker run --detach --rm --name core --privileged --volume /opt/core/config:/core/config --volume /opt/core/data:/core/data --publish 80:8080 --publish 443:8181 --publish 1935:1935 --publish 1936:1936 --publish 6000:6000/udp datarhei/restreamer:latest
  • datarhei-core v16.15.0 (linux/amd64) - long-mud-0635

Could you help me, please?

Thanks Sebastian

sincar74 avatar May 07 '24 14:05 sincar74

Hi, inspecting with developer tools on Restremer gui, I realize that "collectors" are parameters for which I want the session information. With collectors=hls I can retrieve what I'm searching for. To have the number of viewers then, I suppose that, I have to count the numbers of object that have the channels guid inside the reference property.

sincar74 avatar May 07 '24 15:05 sincar74

Yes, in the active.list you have count the objects that contain the channel ID in the reference in order to get the number of currently watching viewers.

ioppermann avatar May 17 '24 09:05 ioppermann

Perfect, may thanks

sincar74 avatar May 17 '24 10:05 sincar74