Compare commits
7 Commits
c21b0e59d1
...
latest
Author | SHA1 | Date | |
---|---|---|---|
d7ca87d9e5 | |||
f5bb59f433 | |||
09745960cc | |||
ae3023d688 | |||
6f4cd93528 | |||
f9e8345eba | |||
d63589fe73 |
96
Biblio.bib
@@ -165,6 +165,14 @@
|
||||
note = {[Accessed 20-03-2025]}
|
||||
}
|
||||
|
||||
@misc{geeksforgeeksAggregationMongoDB,
|
||||
author = {},
|
||||
title = {{A}ggregation in {M}ongo{D}{B} - {G}eeksfor{G}eeks --- geeksforgeeks.org},
|
||||
howpublished = {\url{https://www.geeksforgeeks.org/aggregation-in-mongodb/}},
|
||||
year = {},
|
||||
note = {[Accessed 01-04-2025]}
|
||||
}
|
||||
|
||||
@misc{geeksforgeeksContainerizationUsing,
|
||||
author = {},
|
||||
title = {{C}ontainerization using {D}ocker - {G}eeksfor{G}eeks --- geeksforgeeks.org},
|
||||
@@ -221,6 +229,22 @@
|
||||
note = {[Accessed 18-03-2025]}
|
||||
}
|
||||
|
||||
@misc{influxdataInfrastructureMonitoring,
|
||||
author = {},
|
||||
title = {{I}nfrastructure {M}onitoring {B}asics with {T}elegraf, {I}nflux{D}{B}, and {G}rafana --- influxdata.com},
|
||||
howpublished = {\url{https://www.influxdata.com/blog/infrastructure-monitoring-basics-telegraf-influxdb-grafana/}},
|
||||
year = {},
|
||||
note = {[Accessed 01-04-2025]}
|
||||
}
|
||||
|
||||
@misc{innovationyourselfDockerDocker,
|
||||
author = {},
|
||||
title = {{D}ocker vs {D}ocker {C}ompose vs {D}ocker {S}warm s docker engine --- innovationyourself.com},
|
||||
howpublished = {\url{https://innovationyourself.com/docker-vs-docker-compose-vs-docker-swarm/}},
|
||||
year = {},
|
||||
note = {[Accessed 01-04-2025]}
|
||||
}
|
||||
|
||||
@misc{ipfsIPFSWhitepaper,
|
||||
doi = {10.48550/ARXIV.1407.3561},
|
||||
url = {https://arxiv.org/abs/1407.3561},
|
||||
@@ -331,6 +355,14 @@
|
||||
note = {[Accessed 07-Mar-2023]}
|
||||
}
|
||||
|
||||
@misc{qabrainsSeleniumGrid,
|
||||
author = {},
|
||||
title = {{S}elenium {G}rid 4 - {A}rchitecture and {C}ommunication --- qabrains.com},
|
||||
howpublished = {\url{https://qabrains.com/selenium-grid-4-architecture-and-communication}},
|
||||
year = {},
|
||||
note = {[Accessed 01-04-2025]}
|
||||
}
|
||||
|
||||
@phdthesis{ResearchBasedDataRightsManagementUsingBlockchainOverEthereumNetwork,
|
||||
author = {Naz, Muqaddas and Javaid, Nadeem and Iqbal, Sohail},
|
||||
year = {2019},
|
||||
@@ -439,6 +471,14 @@
|
||||
month = {9}
|
||||
}
|
||||
|
||||
@online{The360Degree,
|
||||
author = {The 360 Degree},
|
||||
title = {Own work},
|
||||
year = {2022},
|
||||
url = {https://commons.wikimedia.org/w/index.php?curid=116056511},
|
||||
note = {Licensed under CC BY-SA 4.0}
|
||||
}
|
||||
|
||||
@misc{theoryBitTorrentSpecificationTheoryOrg,
|
||||
author = {},
|
||||
title = {{B}it{T}orrent{S}pecification - {T}heory{O}rg --- wiki.theory.org},
|
||||
@@ -483,6 +523,22 @@
|
||||
note = {[Accessed 11-Feb-2023]}
|
||||
}
|
||||
|
||||
@misc{uclvDockerOverview,
|
||||
author = {},
|
||||
title = {{D}ocker overview --- docker-docs.uclv.cu},
|
||||
howpublished = {\url{https://docker-docs.uclv.cu/get-started/overview/}},
|
||||
year = {},
|
||||
note = {[Accessed 01-04-2025]}
|
||||
}
|
||||
|
||||
@online{VignoniCalimo2009,
|
||||
author = {David Vignoni and Calimo},
|
||||
title = {By Gnome-fs-client.svg: David Vignoni, Gnome-fs-server.svg: David Vignoni, derivative work: Calimo},
|
||||
year = {2009},
|
||||
url = {https://commons.wikimedia.org/w/index.php?curid=15782858},
|
||||
note = {Licensed under LGPL}
|
||||
}
|
||||
|
||||
@misc{w3c,
|
||||
author = {W3C},
|
||||
title = {What is the difference between the Web and the Internet?},
|
||||
@@ -523,6 +579,38 @@
|
||||
note = {[Online; accessed 05-April-2023]}
|
||||
}
|
||||
|
||||
@misc{wiki:Broadcasting_networking,
|
||||
author = {Wikipedia},
|
||||
title = {{Broadcasting (networking)} --- {W}ikipedia{,} The Free Encyclopedia},
|
||||
year = {2025},
|
||||
howpublished = {\url{http://en.wikipedia.org/w/index.php?title=Broadcasting\%20(networking)&oldid=1238402634}},
|
||||
note = {[Online; accessed 31-March-2025]}
|
||||
}
|
||||
|
||||
@misc{wiki:Content_delivery_network,
|
||||
author = {Wikipedia},
|
||||
title = {{Content delivery network} --- {W}ikipedia{,} The Free Encyclopedia},
|
||||
year = {2025},
|
||||
howpublished = {\url{http://en.wikipedia.org/w/index.php?title=Content\%20delivery\%20network&oldid=1279155231}},
|
||||
note = {[Online; accessed 31-March-2025]}
|
||||
}
|
||||
|
||||
@misc{wiki:Multicast,
|
||||
author = {Wikipedia},
|
||||
title = {{Multicast} --- {W}ikipedia{,} The Free Encyclopedia},
|
||||
year = {2025},
|
||||
howpublished = {\url{http://en.wikipedia.org/w/index.php?title=Multicast&oldid=1270123732}},
|
||||
note = {[Online; accessed 31-March-2025]}
|
||||
}
|
||||
|
||||
@misc{wiki:Network_address_translation,
|
||||
author = {Wikipedia},
|
||||
title = {{Network address translation} --- {W}ikipedia{,} The Free Encyclopedia},
|
||||
year = {2025},
|
||||
howpublished = {\url{http://en.wikipedia.org/w/index.php?title=Network\%20address\%20translation&oldid=1283227709}},
|
||||
note = {[Online; accessed 01-April-2025]}
|
||||
}
|
||||
|
||||
@misc{wiki:PeerTube,
|
||||
author = {Wikipedia},
|
||||
title = {{PeerTube} --- {W}ikipedia{,} The Free Encyclopedia},
|
||||
@@ -531,6 +619,14 @@
|
||||
note = {[Online; accessed 24-March-2025]}
|
||||
}
|
||||
|
||||
@misc{wiki:Unicast,
|
||||
author = {Wikipedia},
|
||||
title = {{Unicast} --- {W}ikipedia{,} The Free Encyclopedia},
|
||||
year = {2025},
|
||||
howpublished = {\url{http://en.wikipedia.org/w/index.php?title=Unicast&oldid=1222709440}},
|
||||
note = {[Online; accessed 31-March-2025]}
|
||||
}
|
||||
|
||||
@misc{wikipediaLicenzainformatica,
|
||||
author = {Wikipedia},
|
||||
title = {{L}icenza (informatica) - {W}ikipedia --- it.wikipedia.org},
|
||||
|
BIN
images/Broadcast.png
Normal file
After Width: | Height: | Size: 202 KiB |
BIN
images/Client-server-model.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
images/Multicast.png
Normal file
After Width: | Height: | Size: 176 KiB |
BIN
images/Unicast.png
Normal file
After Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 39 KiB |
BIN
images/grafana-default-latency.png
Normal file
After Width: | Height: | Size: 86 KiB |
BIN
images/grafana-high-latency.png
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
images/p2p-network.png
Normal file
After Width: | Height: | Size: 158 KiB |
103
peertube/datavis/CRUD/player-statistics.js
Normal file
@@ -0,0 +1,103 @@
|
||||
/* global use, db */
|
||||
// MongoDB Playground
|
||||
// To disable this template go to Settings | MongoDB | Use Default Template For Playground.
|
||||
// Make sure you are connected to enable completions and to be able to run a playground.
|
||||
// Use Ctrl+Space inside a snippet or a string literal to trigger completions.
|
||||
// The result of the last command run in a playground is shown on the results panel.
|
||||
// By default the first 20 documents will be returned with a cursor.
|
||||
// Use 'console.log()' to print to the debug output.
|
||||
// For more documentation on playgrounds please refer to
|
||||
// https://www.mongodb.com/docs/mongodb-vscode/playgrounds/
|
||||
|
||||
// Select the database to use.
|
||||
use('statistics');
|
||||
|
||||
// Insert a few documents into the sales collection.
|
||||
db.getCollection('peertube_hetzner_high_latency').aggregate(
|
||||
[
|
||||
{
|
||||
$group: {
|
||||
_id: "$tags.session",
|
||||
maxDownPeers: {
|
||||
$max: "$player.Download Breakdown.Peers"
|
||||
},
|
||||
maxDownServer: {
|
||||
$max: "$player.Download Breakdown.Server"
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: null,
|
||||
totalDownPeers: {
|
||||
$sum: "$maxDownPeers"
|
||||
},
|
||||
totalDownServer: {
|
||||
$sum: "$maxDownServer"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
_id: 0,
|
||||
totalDownPeers: 1,
|
||||
totalDownServer: 1,
|
||||
totalComputedDown: {
|
||||
$sum: [
|
||||
"$totalDownPeers",
|
||||
"$totalDownServer"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
totalDownPeers: 1,
|
||||
totalDownServer: 1,
|
||||
totalComputedDown: 1,
|
||||
percentageOfTotalPeers: {
|
||||
$round: {
|
||||
$multiply: [
|
||||
{
|
||||
$divide: [
|
||||
"$totalDownPeers",
|
||||
"$totalComputedDown"
|
||||
]
|
||||
},
|
||||
100
|
||||
]
|
||||
}
|
||||
},
|
||||
percentageOfTotalServer: {
|
||||
$round: {
|
||||
$multiply: [
|
||||
{
|
||||
$divide: [
|
||||
"$totalDownServer",
|
||||
"$totalComputedDown"
|
||||
]
|
||||
},
|
||||
100
|
||||
]
|
||||
}
|
||||
},
|
||||
ratio: {
|
||||
$round: {
|
||||
$divide: [
|
||||
"$totalDownPeers",
|
||||
"$totalDownServer"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
$sort: {
|
||||
ratio: -1
|
||||
}
|
||||
},
|
||||
{
|
||||
$limit: 10
|
||||
}
|
||||
]
|
||||
)
|
255
peertube/datavis/CRUD/webrtc-statistics.js
Normal file
@@ -0,0 +1,255 @@
|
||||
/* global use, db */
|
||||
// MongoDB Playground
|
||||
// To disable this template go to Settings | MongoDB | Use Default Template For Playground.
|
||||
// Make sure you are connected to enable completions and to be able to run a playground.
|
||||
// Use Ctrl+Space inside a snippet or a string literal to trigger completions.
|
||||
// The result of the last command run in a playground is shown on the results panel.
|
||||
// By default the first 20 documents will be returned with a cursor.
|
||||
// Use 'console.log()' to print to the debug output.
|
||||
// For more documentation on playgrounds please refer to
|
||||
// https://www.mongodb.com/docs/mongodb-vscode/playgrounds/
|
||||
use("statistics");
|
||||
|
||||
let formattedDate = (date) => ({
|
||||
unix: { $toLong: date },
|
||||
iso: { $toString: date },
|
||||
});
|
||||
|
||||
// Find the minimum timestamp and calculate the maximum timestamp (one hour later) for a collection
|
||||
function getTimeWindow(collectionName) {
|
||||
const minTimestamp = db.getCollection(collectionName).aggregate([
|
||||
{ $sort: { timestamp: 1 } },
|
||||
{ $limit: 1 },
|
||||
{ $project: { _id: 0, timestamp: 1 } }
|
||||
]).toArray()[0]?.timestamp;
|
||||
|
||||
if (!minTimestamp) return null;
|
||||
|
||||
const maxTimestamp = new Date(minTimestamp.getTime() + 60 * 60 * 1000);
|
||||
return { minTimestamp, maxTimestamp };
|
||||
}
|
||||
|
||||
// Get time windows for both collections
|
||||
const highLatencyTimeWindow = getTimeWindow("peertube_hetzner_high_latency");
|
||||
const defaultLatencyTimeWindow = getTimeWindow("peertube_hetzner_default_latency");
|
||||
|
||||
// Function to perform the aggregation for a given collection
|
||||
function getAggregationResult(collectionName, timeWindow) {
|
||||
if (!timeWindow) return [];
|
||||
|
||||
return db.getCollection(collectionName).aggregate([
|
||||
// Filter documents within the collection's specific time window
|
||||
{
|
||||
$match: {
|
||||
timestamp: {
|
||||
$gte: timeWindow.minTimestamp,
|
||||
$lt: timeWindow.maxTimestamp
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
$unwind: "$peers"
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
"peers.iceConnectionState": "connected"
|
||||
}
|
||||
},
|
||||
{
|
||||
$unwind: "$peers.values"
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
"peers.values.type": "data-channel",
|
||||
}
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: "$peers.id",
|
||||
maxBytesReceived: {
|
||||
$max: "$peers.values.bytesReceived"
|
||||
},
|
||||
maxBytesSent: {
|
||||
$max: "$peers.values.bytesSent"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: null,
|
||||
totalMaxBytesReceived: {
|
||||
$sum: "$maxBytesReceived"
|
||||
},
|
||||
totalMaxBytesSent: {
|
||||
$sum: "$maxBytesSent"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
_id: 0,
|
||||
collection: collectionName,
|
||||
totalBytesReceived: "$totalMaxBytesReceived",
|
||||
totalBytesSent: "$totalMaxBytesSent",
|
||||
formattedBytesReceived: {
|
||||
$switch: {
|
||||
branches: [
|
||||
{
|
||||
case: {
|
||||
$gte: [
|
||||
"$totalMaxBytesReceived",
|
||||
1073741824 // 1024^3
|
||||
]
|
||||
},
|
||||
then: {
|
||||
$concat: [
|
||||
{
|
||||
$toString: {
|
||||
$divide: [
|
||||
"$totalMaxBytesReceived",
|
||||
1073741824 // 1024^3
|
||||
]
|
||||
}
|
||||
},
|
||||
" GiB"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
case: {
|
||||
$gte: [
|
||||
"$totalMaxBytesReceived",
|
||||
1048576 // 1024^2
|
||||
]
|
||||
},
|
||||
then: {
|
||||
$concat: [
|
||||
{
|
||||
$toString: {
|
||||
$divide: [
|
||||
"$totalMaxBytesReceived",
|
||||
1048576 // 1024^2
|
||||
]
|
||||
}
|
||||
},
|
||||
" MiB"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
case: {
|
||||
$gte: [
|
||||
"$totalMaxBytesReceived",
|
||||
1024 // 1024^1
|
||||
]
|
||||
},
|
||||
then: {
|
||||
$concat: [
|
||||
{
|
||||
$toString: {
|
||||
$divide: [
|
||||
"$totalMaxBytesReceived",
|
||||
1024 // 1024^1
|
||||
]
|
||||
}
|
||||
},
|
||||
" KiB"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
default: {
|
||||
$concat: [
|
||||
{
|
||||
$toString:
|
||||
"$totalMaxBytesReceived"
|
||||
},
|
||||
" bytes"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
formattedBytesSent: {
|
||||
$switch: {
|
||||
branches: [
|
||||
{
|
||||
case: {
|
||||
$gte: [
|
||||
"$totalMaxBytesSent",
|
||||
1073741824 // 1024^3
|
||||
]
|
||||
},
|
||||
then: {
|
||||
$concat: [
|
||||
{
|
||||
$toString: {
|
||||
$divide: [
|
||||
"$totalMaxBytesSent",
|
||||
1073741824 // 1024^3
|
||||
]
|
||||
}
|
||||
},
|
||||
" GiB"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
case: {
|
||||
$gte: [
|
||||
"$totalMaxBytesSent",
|
||||
1048576 // 1024^2
|
||||
]
|
||||
},
|
||||
then: {
|
||||
$concat: [
|
||||
{
|
||||
$toString: {
|
||||
$divide: [
|
||||
"$totalMaxBytesSent",
|
||||
1048576 // 1024^2
|
||||
]
|
||||
}
|
||||
},
|
||||
" MiB"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
case: {
|
||||
$gte: ["$totalMaxBytesSent", 1024] // 1024^1
|
||||
},
|
||||
then: {
|
||||
$concat: [
|
||||
{
|
||||
$toString: {
|
||||
$divide: [
|
||||
"$totalMaxBytesSent",
|
||||
1024 // 1024^1
|
||||
]
|
||||
}
|
||||
},
|
||||
" KiB"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
default: {
|
||||
$concat: [
|
||||
{ $toString: "$totalMaxBytesSent" },
|
||||
" bytes"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]).toArray();
|
||||
}
|
||||
|
||||
// Get results from both collections using their respective time windows
|
||||
const highLatencyResults = getAggregationResult("peertube_hetzner_high_latency", highLatencyTimeWindow);
|
||||
const defaultLatencyResults = getAggregationResult("peertube_hetzner_default_latency", defaultLatencyTimeWindow);
|
||||
|
||||
// Combine and return the results
|
||||
const combinedResults = [...highLatencyResults, ...defaultLatencyResults];
|
||||
combinedResults;
|