Skip to content

Commit

Permalink
Merge pull request #506 from ant-media/add-playback-stats
Browse files Browse the repository at this point in the history
Add playback stats for WebRTC and add test codes
  • Loading branch information
mekya authored Oct 19, 2024
2 parents 5879368 + 6b4bb5e commit a8821c1
Show file tree
Hide file tree
Showing 6 changed files with 2,457 additions and 2,187 deletions.
6 changes: 5 additions & 1 deletion karma.conf.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ module.exports = function(config) {
frameworks: ['mocha', 'chai', 'sinon'],
files: [
{ pattern: "src/test/js/**/*.js", type: "module" },
{ pattern: "src/main/js/**/*.js", included: false }
{ pattern: "src/main/js/**/*.js", included: false, served:true }

],

proxies: {
'/volume-meter-processor.js': '/base/src/main/js/volume-meter-processor.js'
},

reporters: ['progress', 'coverage'],

Expand Down
37 changes: 34 additions & 3 deletions src/main/js/peer_stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,44 @@ export class PeerStats {
this.lastBytesSent = 0;

/**
* @deprecated use videoPacketsSent
* The total number of video packets sent.
* @type {number}
*/
this.totalVideoPacketsSent = 0;
/**
* The total number of video packets sent.
* @type {number}
*/
this.videoPacketsSent = 0;
/**
* The total number of video packets received.
* @type {number}
*/
this.videoPacketsReceived = 0;


/**
* The total number of audio packets sent.
* @deprecated use audioPacketsSent
* The total number of audio packets sent.
* @type {number}
*/
this.totalAudioPacketsSent = 0;

/**

/**
*
* The total number of audio packets sent.
* @type {number}
*/
this.audioPacketsSent = 0;
/*
* The total number of audio packets received.
* @type {number}
*
* */
this.audioPacketsReceived = 0;

/**
* The current timestamp.
* @type {number}
*/
Expand Down Expand Up @@ -216,6 +242,11 @@ export class PeerStats {
* @type {*[]}
*/
this.inboundRtpList = [];

/**
* The current round trip time for the candidate pair
*/
this.currentRoundTripTime = 0;
}
//kbits/sec
get averageOutgoingBitrate() {
Expand Down
Loading

0 comments on commit a8821c1

Please sign in to comment.