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
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m5s
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user