How to implement total subscribed minutes of a Session

Hi,
I have a requirement to calculate the total subscribed minutes of a session.

For e.g. If a session has 2 subscribers(User-1 and User-2) and they consumed the stream for 5 minutes and 10 minutes respectively then
Total Subscribed minutes of the Session would be = Total minutes subscribed by User-1 + Total Minutes subscribed by User-2

I can handle this independently on my APP using user connect and disconnect event, but i want to make it the part of Openvidu Inspector or Openvidu Kibana dashboard.

While exploring the Inspector panel i found a section “History” where it seems showing the same set of data which i need but i am confused how the calculation is being done. I am attaching the screen shot and please describe how the calculation is being done for
"Total Users", “Total Connections”, “Total Publisher”, “Total Subscribers”, "Streamed Time"


For your information,

  • I had only 1 Publisher and 4 subscriber in this session but it’s showing 4 Publisher and 19 subscribers.
  • Each users (Publisher and Subscribers) was getting connected and disconnected multiple times. I don’t know the exact number of times they connected and disconnected but it would be approx 3-4 times each.
  • Session started at 11:26 and ended at 11:31 which is total 15 Minutes but in History section it’s showing 25 Mints. It may be because we have set 10 minutes times to auto stop the recording that why it seems showing total Duration = 25 Mints

Please help to understand the calculation of each field mentioned above.

If i need to achieve the same thing from Kibana how can i achieve it?

Each users (Publisher and Subscribers) was getting connected and disconnected multiple times.

There you have the reason why you get 4 publishers per userand 19 subscribers. Each stream represents a single Publisher or Subscriber since it is created until it is destroyed. If a user creates and destroys multiple entities, they will show up as different Publishers or Subscribers.

To implement your own visualizations in Kibana, just take a look to this documentation: OpenVidu Docs

You can make use of the xxxxSummary Elasticsearch documents to get all of the information shown by OpenVidu Inspector in the History page (in fact, OpenVidu Inspector gets it from these very same events).

Thanks @pabloFuente for the information,
Can you please confirm one thing Streamed Time showing in History section - Is it the total duration of every subscribers connected in the session? Or every subscribers + every publishers both is considered.

Streamed time as shwon by the History page is the addition of all Publishers and Subscribers duration.
For example, this user’s Connection to a session:

In total has 17:20 + 17:02 + 00:11 = 34:33 streamed time

Thanks @pabloFuente for the clarification.