Skip to content

Instantly share code, notes, and snippets.

@arbaz52
Created January 20, 2022 09:33
Show Gist options
  • Save arbaz52/fc71d4180a1f215ad0f2456e06ab794f to your computer and use it in GitHub Desktop.
Save arbaz52/fc71d4180a1f215ad0f2456e06ab794f to your computer and use it in GitHub Desktop.
CT-741

CT-741

The goal of this document is to help answer the following:

  • How to calculate cost of using Vonage's video API?
  • How do we access/store/maintain required data/information?

This document assumes we are being billed based on PPM (Participant-based Pricing Model).

What is PPM?

PPM is an abbreviation for Participant-based Pricing Model. The pricing is calculated dynamically each minute based on number of participants inside a video session.

Please refer to pricing page for more information.

Calculating usage

Timeline of users attending the session

Method A:

00.05 - 00.10: User 1 (5 min)
00.10 - 00.15: User 1, User 2, User 3 (3 x 5min = 15 min)
00.15 - 00.25: User 2, User 3 (2 x 10 min = 20 min)
00.25 - 00.30: User 2 (5 min)

Total Participant Minutes = (5+15+20+5) = 45 participant minutes.

Method B: Another way to look at the same scenario is:

User 1: (10 mins)
User 2: (20 mins)
User 3: (15 mins)

Total Participant Minutes = (10+20+15) = 45 participant minutes.

Method B does not hold up for meetings that cross over 25 active publisher as the cost starts varying after 25 active publishers. This is mentioned here.

For more details or FAQs, please refer to original article.

Maintaining logs

Sending requests to server after a period of time might bottleneck it if there are multiple sessions going on with multiple users, this will eventually lead to other users having to wait a bit longer for their requests to be full-filled by the server.

Solution A

I suggest we either maintain the logs on the front end inside the session/local storage and only send those once the meeting has ended or the next time user hops onto the website. But this would lead to no data sent to the server if the user closes the page.

If the user closes the tab or browser, we can use the Beacon API to send information back to the server using like this. But if the user closes the browser, some browsers do not send the request.

Solution B

We increase the time interval between requests so that bottleneck can be avoided and instead of storing/maintaining session information on the front-end, we can send it back to the back-end.

Solution C

We can also mix the two together to remove each other's cons.

Links

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