[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 CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
||||
* @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",
|
||||
"version": "1.6.39",
|
||||
"version": "1.6.40",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mirotalk",
|
||||
"version": "1.6.39",
|
||||
"version": "1.6.40",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@mattermost/client": "11.1.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mirotalk",
|
||||
"version": "1.6.39",
|
||||
"version": "1.6.40",
|
||||
"description": "A free WebRTC browser-based video call",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ let brand = {
|
||||
},
|
||||
about: {
|
||||
imageUrl: '../images/mirotalk-logo.gif',
|
||||
title: 'WebRTC P2P v1.6.39',
|
||||
title: 'WebRTC P2P v1.6.40',
|
||||
html: `
|
||||
<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 CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||
* @version 1.6.39
|
||||
* @version 1.6.40
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -12322,7 +12322,7 @@ function showAbout() {
|
||||
Swal.fire({
|
||||
background: swBg,
|
||||
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,
|
||||
customClass: { image: 'img-about' },
|
||||
html: `
|
||||
|
||||
@@ -77,13 +77,24 @@ function bytesToSize(bytes) {
|
||||
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 */
|
||||
function showNetworkStats(stats) {
|
||||
networkSent.innerText = stats.bytesSent;
|
||||
networkReceived.innerText = stats.bytesReceived;
|
||||
networkJitter.innerText = stats.jitter.toFixed(3) + ' s';
|
||||
networkSent.innerText = bytesToSize(stats.bytesSent);
|
||||
networkReceived.innerText = bytesToSize(stats.bytesReceived);
|
||||
networkJitter.innerText = timeToReadable(stats.jitter);
|
||||
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;
|
||||
|
||||
showNetworkStats({
|
||||
bytesSent: bytesToSize(global.bytesSent),
|
||||
bytesReceived: bytesToSize(global.bytesReceived),
|
||||
bytesSent: global.bytesSent,
|
||||
bytesReceived: global.bytesReceived,
|
||||
packetsLost: global.packetsLost,
|
||||
jitter: global.jitter,
|
||||
rtt: global.rtt,
|
||||
|
||||
Reference in New Issue
Block a user