Note
This repo is only one part of the bigger peer metrics WebRTC monitoring service. Check out the full project here.
This folder contains code for the API server used to ingest the metrics sent by the SDK.
This is a public API endpoint that has two functions:
- ingesting data collected by the SDK
- used for data query by
web
In addition to this, the api has the django admin interface to check the raw data collected.
To run this locally check the main project page.
- Language: Python 3.8
- Framework: Django
- DB: Postgres
The main models from this project are:
An organization is pretty much a way to group apps
Used to group conferences.
The main model for data collection. Used to group: events, sessions and participants
A conference is pretty much a call between participants. A user is encouraged to not reuse conferece_id
s.
A persona who takes part in a call/conference. You could say this is a user's user.
A session is the presence of a participants in a conference. He can have multiple sessions if he joins multiple times.
This model represents all the events that we save during a call. We differentiate between them by the category
attribute.
We can group the routes into 2 categories: public (used by the SDK) and private (used accounts to query data for the charts).
/initialize
: first endpoint hit by SDK. checks that it has a validapi_key
, etc. returns the tokenPOST
/events/get-user-media
: gUM eventsPOST
/events/browser
: browser events: unload, page visibility, etcPOST
/connection
: connection events: sdp, ice, peer eventsPOST
/connection/batch
: same as previous but accepts batched requestsPOST
/stats
: receiving webrtc statsPOST
/sessions
: used to create a participant sessionsPOST
: create a new sessionPUT
: update a participant's session
/sessions
: used to get participant sessionsGET
, arguments:conferenceId
participantId
appId
/sessions/<uuid:pk>
: get a specific sessionGET
/organizations
: used to get a user's organizationsPOST
/organizations/<uuid:pk>
: get a specific orgGET
PUT
DELETE
/apps
: get a user's apps-
POST
-
/apps/<uuid:pk>
GET
PUT
DELETE
/conferences
GET
, argumentsappId
participantId
/conferences/<uuid:pk>
GET
/conferences/<uuid:pk>/events
GET
- return all events for a conference- arguments (optional):
- type: filter out events by type. eg:
?type=stats
- type: filter out events by type. eg:
/participants
GET
, argumentsappId
/participants/<uuid:pk>
GET
/search
GET
, argumentsquery