feat: integrate yaspin for improved logging and error handling in Chrome driver setup
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m5s

This commit is contained in:
2025-02-14 15:15:59 +01:00
parent f579000a96
commit 0518d1ba48
3 changed files with 18 additions and 10 deletions

View File

@@ -22,7 +22,7 @@ class WebrtcInternalExporter {
});
window.postMessage({ event: "webrtc-internal-exporter:ready" });
this.collectAllStats();
setInterval(() => this.collectAndPostAllStats(), this.updateInterval);
}
randomId() {
@@ -41,7 +41,7 @@ class WebrtcInternalExporter {
this.peerConnections.set(id, pc);
pc.addEventListener("connectionstatechange", () => {
log(`connectionStateChange: ${pc.connectionState}`);
this.collectAndPostSingleStat(id);
this.collectAndPostAllStats();
if (pc.connectionState === "closed") {
this.peerConnections.delete(id);
@@ -100,7 +100,7 @@ class WebrtcInternalExporter {
log(`Single stat collected:`, [stats]);
}
async collectAllStats() {
async collectAndPostAllStats() {
const stats = [];
for (const [id] of this.peerConnections) {
@@ -120,8 +120,7 @@ class WebrtcInternalExporter {
);
log(`Stats collected:`, stats);
setTimeout(this.collectAllStats.bind(this), this.updateInterval);
return stats;
}