INNER CODE UNIT · TypeScript

threshold

gommzystudio/device-activity-tracker · src/signal-tracker.ts:417

            threshold = median * 0.9;

            if (movingAvg < threshold) {
                metrics.state = 'Online';
            } else {
                metrics.state = 'Standby';
            }
        } else {
            metrics.state = 'Calibrating...';
        }

        const stateColor = metrics.state === 'Online' ? '🟢' : metrics.state === 'Standby' ? '🟡' : '⚪';
        logger.info(`${stateColor} ${identifier}: ${metrics.state} (RTT: ${metrics.lastRtt}ms, Avg: ${movingAvg.toFixed(0)}ms)`);
    }

    private sendUpdate() {
        const devices = Array.from(this.deviceMetrics.entries()).map(([id, metrics]) => ({
            jid: id,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…