Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mypurecloud/webrtc-stats-gatherer
WebRTC Stats Gatherer
https://github.com/mypurecloud/webrtc-stats-gatherer
webrtc webrtc-stats webrtc-tools
Last synced: 15 days ago
JSON representation
WebRTC Stats Gatherer
- Host: GitHub
- URL: https://github.com/mypurecloud/webrtc-stats-gatherer
- Owner: MyPureCloud
- License: mit
- Created: 2016-06-16T14:52:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-05T19:59:35.000Z (4 months ago)
- Last Synced: 2024-12-09T19:11:36.535Z (25 days ago)
- Topics: webrtc, webrtc-stats, webrtc-tools
- Language: TypeScript
- Homepage:
- Size: 1020 KB
- Stars: 19
- Watchers: 33
- Forks: 3
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# WebRTC Stats Gatherer
This module is designed to collect [RTCPeerConnection](https://github.com/otalk/rtcpeerconnection) stats on a regular interval
and emit stats and trace data as appropriate.Note that this project makes use of event emitting capabilities of [RTCPeerConnection](https://github.com/otalk/rtcpeerconnection) as opposed to a raw browser RTCPeerConnection.
## API
`constructor(peerConnection: RTCPeerConnection, opts: StatsGathererOpts)`
```
interface StatsGathererOpts {
session?: string; // sessionId
initiator?: string;
conference?: string; // conversationId
interval?: number; // interval, in seconds, at which stats are polled (default to 5)
logger?: any; // defaults to console
}
```## Usage
```
import StatsGatherer from 'webrtc-stats-gatherer';const gatherer = new StatsGatherer(myPeerConnection);
gatherer.on('stats', (statsEvent) => doSomethingWithStats(statsEvent));
```