0.40.32 • Published 12 days ago

@observertc/observer-js v0.40.32

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
12 days ago

Server side component for monitoring WebRTC applications and services

Table of Contents:

Qucik Start

Install it from npm package repository.

npm i @observertc/observer-js

Use it in your server side NodeJS app.

import { createObserver, ClientSample } from "@observertc/observer-js";

const observer = createObserver({
    defaultServiceId: 'my-service-name',
    defaultMediaUnitId: 'my-reporting-component',
});

const observedCall = observer.createObservedCall({
    roomId: 'roomId',
    callId: 'room-session-id',
});

const observedClient = observedCall.createObservedClient({
    clientId: 'client-id',
    mediaUnitId: 'media-unit-id',
});

const clientSample: ClientSample; // Receive your samples, for example, from a WebSocket

observedClient.accept(clientSample);

The above example do as follows: 1. create an observer to evaluate samples from clients and sfus 2. create a client source object to accept client samples 3. add an evaluator process to evaluate ended calls

Get a Summary of a call when it ends

const monitor = observer.createCallSummaryMonitor('summary', (summary) => {
    console.log('Call Summary', summary);
});

How Many Clients are using TURN?

const monitor = observer.createTurnUsageMonitor('turn', (turn) => {
    console.log('TURN', turn);
});

// at any point of time you can get the current state of the turn usage

console.log('Currently ', monitor.clients.size, 'clients are using TURN');

// you can get the incoming and outgoing bytes of the TURN server
console.log(`${YOUR_TURN_SERVER_ADDRESS} usage:`, monitor.getUsage(YOUR_TURN_SERVER_ADDRESS));

Monitor Calls and Clients as they updated

observer.on('newcall', (call) => {
    call.on('update', () => {
        console.log('Call Updated', call.callId);
    });

    call.on('newclient', (client) => {

        client.on('update', () => {
            console.log('Client Updated', client.clientId);

            console.log(`The avaialble incoming bitrate for the client ${client.clientId} is: ${client.availableIncomingBitrate}`)
        });
    })
});

NPM package

https://www.npmjs.com/package/@observertc/observer-js

Schemas

https://github.com/observertc/schemas

License

Apache-2.0

0.40.32

12 days ago

0.40.31

16 days ago

0.40.30

16 days ago

0.40.29

19 days ago

0.40.28

28 days ago

0.40.27

28 days ago

0.40.20

1 month ago

0.40.24

1 month ago

0.40.25

1 month ago

0.40.22

1 month ago

0.40.23

1 month ago

0.40.26

1 month ago

0.40.19

1 month ago

0.40.13

1 month ago

0.40.14

1 month ago

0.40.12

1 month ago

0.40.17

1 month ago

0.40.18

1 month ago

0.40.15

1 month ago

0.40.16

1 month ago

0.40.11-beta

2 months ago

0.40.10-beta

2 months ago

0.40.8-beta

2 months ago

0.40.9-beta

2 months ago

0.40.7-beta

2 months ago

0.40.4-beta

2 months ago

0.40.5-beta

2 months ago

0.40.6-beta

2 months ago

0.40.3-beta

2 months ago

0.40.2-beta

2 months ago

0.40.1-beta

2 months ago

0.40.0-beta

2 months ago

0.30.6-beta

2 months ago

0.30.4-beta

2 months ago

0.30.5-beta

2 months ago

0.30.2-beta

2 months ago

0.30.3-beta

2 months ago

0.30.1-beta

2 months ago

0.30.0-beta

2 months ago

0.30.0-e12fcb4.0

2 months ago

0.9.27-beta

3 months ago

0.9.26-beta

3 months ago

0.9.25-beta

4 months ago

0.9.24-beta

4 months ago

0.9.23-beta

4 months ago

0.9.22-beta

4 months ago

0.9.17-beta

8 months ago

0.9.15-beta

10 months ago

0.9.18-beta

8 months ago

0.9.21-beta

6 months ago

0.9.19-beta

8 months ago

0.9.20-beta

6 months ago

0.9.16-beta

10 months ago

0.9.14-beta

11 months ago

0.9.12-beta

12 months ago

0.9.11-beta

12 months ago

0.9.13-beta

11 months ago

0.9.10-beta

1 year ago

0.9.9-beta

1 year ago

0.9.8-beta

1 year ago

0.9.7-beta

1 year ago

0.9.6-beta

1 year ago

0.9.5-beta

1 year ago

0.9.4-beta

1 year ago

0.9.3-beta

1 year ago

0.9.2-beta

1 year ago

0.9.1-beta

1 year ago

0.9.0-beta

1 year ago