[mirotalk] - improve network stats
This commit is contained in:
+1
-1
@@ -45,7 +45,7 @@ dependencies: {
|
|||||||
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
|
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
|
||||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
||||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||||
* @version 1.6.39
|
* @version 1.6.40
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "mirotalk",
|
"name": "mirotalk",
|
||||||
"version": "1.6.39",
|
"version": "1.6.40",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "mirotalk",
|
"name": "mirotalk",
|
||||||
"version": "1.6.39",
|
"version": "1.6.40",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mattermost/client": "11.1.0",
|
"@mattermost/client": "11.1.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mirotalk",
|
"name": "mirotalk",
|
||||||
"version": "1.6.39",
|
"version": "1.6.40",
|
||||||
"description": "A free WebRTC browser-based video call",
|
"description": "A free WebRTC browser-based video call",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+1
-1
@@ -77,7 +77,7 @@ let brand = {
|
|||||||
},
|
},
|
||||||
about: {
|
about: {
|
||||||
imageUrl: '../images/mirotalk-logo.gif',
|
imageUrl: '../images/mirotalk-logo.gif',
|
||||||
title: 'WebRTC P2P v1.6.39',
|
title: 'WebRTC P2P v1.6.40',
|
||||||
html: `
|
html: `
|
||||||
<button
|
<button
|
||||||
id="support-button"
|
id="support-button"
|
||||||
|
|||||||
+2
-2
@@ -15,7 +15,7 @@
|
|||||||
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
|
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
|
||||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
||||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||||
* @version 1.6.39
|
* @version 1.6.40
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -12322,7 +12322,7 @@ function showAbout() {
|
|||||||
Swal.fire({
|
Swal.fire({
|
||||||
background: swBg,
|
background: swBg,
|
||||||
position: 'center',
|
position: 'center',
|
||||||
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.6.39',
|
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.6.40',
|
||||||
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
|
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
|
||||||
customClass: { image: 'img-about' },
|
customClass: { image: 'img-about' },
|
||||||
html: `
|
html: `
|
||||||
|
|||||||
@@ -77,13 +77,24 @@ function bytesToSize(bytes) {
|
|||||||
return (bytes / Math.pow(1024, i)).toFixed(2) + ' ' + sizes[i];
|
return (bytes / Math.pow(1024, i)).toFixed(2) + ' ' + sizes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert seconds to ms, s, h as readable string
|
||||||
|
*/
|
||||||
|
function timeToReadable(seconds) {
|
||||||
|
if (seconds < 1e-3) return (seconds * 1e6).toFixed(2) + ' μs';
|
||||||
|
if (seconds < 1) return (seconds * 1000).toFixed(2) + ' ms';
|
||||||
|
if (seconds < 60) return seconds.toFixed(3) + ' s';
|
||||||
|
if (seconds < 3600) return (seconds / 60).toFixed(2) + ' min';
|
||||||
|
return (seconds / 3600).toFixed(2) + ' h';
|
||||||
|
}
|
||||||
|
|
||||||
/** Display into UI */
|
/** Display into UI */
|
||||||
function showNetworkStats(stats) {
|
function showNetworkStats(stats) {
|
||||||
networkSent.innerText = stats.bytesSent;
|
networkSent.innerText = bytesToSize(stats.bytesSent);
|
||||||
networkReceived.innerText = stats.bytesReceived;
|
networkReceived.innerText = bytesToSize(stats.bytesReceived);
|
||||||
networkJitter.innerText = stats.jitter.toFixed(3) + ' s';
|
networkJitter.innerText = timeToReadable(stats.jitter);
|
||||||
networkPacketLost.innerText = stats.packetsLost;
|
networkPacketLost.innerText = stats.packetsLost;
|
||||||
networkRtt.innerText = stats.rtt.toFixed(3) + ' s';
|
networkRtt.innerText = timeToReadable(stats.rtt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -123,8 +134,8 @@ setInterval(async () => {
|
|||||||
if (rttCount > 0) global.rtt /= rttCount;
|
if (rttCount > 0) global.rtt /= rttCount;
|
||||||
|
|
||||||
showNetworkStats({
|
showNetworkStats({
|
||||||
bytesSent: bytesToSize(global.bytesSent),
|
bytesSent: global.bytesSent,
|
||||||
bytesReceived: bytesToSize(global.bytesReceived),
|
bytesReceived: global.bytesReceived,
|
||||||
packetsLost: global.packetsLost,
|
packetsLost: global.packetsLost,
|
||||||
jitter: global.jitter,
|
jitter: global.jitter,
|
||||||
rtt: global.rtt,
|
rtt: global.rtt,
|
||||||
|
|||||||
Reference in New Issue
Block a user