Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't obtain sessions info from API #749

Closed
sincar74 opened this issue May 7, 2024 · 3 comments
Closed

Can't obtain sessions info from API #749

sincar74 opened this issue May 7, 2024 · 3 comments

Comments

@sincar74
Copy link

sincar74 commented May 7, 2024

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
Copy link
Author

sincar74 commented May 7, 2024

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.

@ioppermann
Copy link
Member

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.

@sincar74
Copy link
Author

Perfect, may thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants