use a 1mb file for calculating bandwidth
This commit is contained in:
parent
1e7c2c26a2
commit
1cc591b247
2 changed files with 5 additions and 4 deletions
|
@ -17,8 +17,8 @@ async function getUserBandwidth() {
|
||||||
userDownloadBandwidthInBitsPerSecond = await getConnectionSpeed();
|
userDownloadBandwidthInBitsPerSecond = await getConnectionSpeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
getUserBandwidth();
|
// get user bandwidth every minute, starting after an initial one minute wait
|
||||||
setInterval(getUserBandwidth, 1000 * 30);
|
setInterval(getUserBandwidth, 1000 * 60);
|
||||||
|
|
||||||
const isProduction = process.env.NODE_ENV === 'production';
|
const isProduction = process.env.NODE_ENV === 'production';
|
||||||
const devInternalApis = process.env.LBRY_API_URL && process.env.LBRY_API_URL.includes('dev');
|
const devInternalApis = process.env.LBRY_API_URL && process.env.LBRY_API_URL.includes('dev');
|
||||||
|
@ -136,6 +136,7 @@ async function sendAndResetWatchmanData() {
|
||||||
let timeSinceLastIntervalSend = new Date() - lastSentTime;
|
let timeSinceLastIntervalSend = new Date() - lastSentTime;
|
||||||
lastSentTime = new Date();
|
lastSentTime = new Date();
|
||||||
|
|
||||||
|
// TODO: hook into here to calculate bandwidth
|
||||||
let protocol;
|
let protocol;
|
||||||
if (videoType === 'application/x-mpegURL') {
|
if (videoType === 'application/x-mpegURL') {
|
||||||
protocol = 'hls';
|
protocol = 'hls';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const imageAddr = 'https://upload.wikimedia.org/wikipedia/commons/a/a6/Brandenburger_Tor_abends.jpg';
|
const imageAddr = 'https://upload.wikimedia.org/wikipedia/commons/b/b9/Pizigani_1367_Chart_1MB.jpg';
|
||||||
const downloadSize = 2707459; // this must match with the image above
|
const downloadSize = 1093957; // this must match with the image above
|
||||||
|
|
||||||
let startTime, endTime;
|
let startTime, endTime;
|
||||||
async function measureConnectionSpeed() {
|
async function measureConnectionSpeed() {
|
||||||
|
|
Loading…
Reference in a new issue