Skip to content

Commit

Permalink
Remove debug metrics logging
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-liang committed Jul 11, 2024
1 parent 1ed4a37 commit c5d2e7f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
7 changes: 0 additions & 7 deletions src/systems/core/mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { ARENA_EVENTS, ACTIONS } from '../../constants';
const warn = AFRAME.utils.debug('ARENA:MQTT:warn');
// const error = AFRAME.utils.debug('ARENA:MQTT:error');

let lastMetricTick = new Date().getTime();

AFRAME.registerSystem('arena-mqtt', {
schema: {
mqttHost: { type: 'string', default: ARENA.defaults.mqttHost },
Expand Down Expand Up @@ -149,11 +147,6 @@ AFRAME.registerSystem('arena-mqtt', {
* @param {object} message
*/
onSceneMessageArrived(message) {
const now = new Date().getTime();
if (now - lastMetricTick > 1000) {
console.log(`Worker message delay: ${now - message.workerTimestamp}ms`);
lastMetricTick = now;
}
delete message.workerTimestamp;
const theMessage = message.payloadObj; // This will be given as json

Expand Down
5 changes: 0 additions & 5 deletions src/systems/core/workers/mqtt-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { expose } from 'comlink';
import * as Paho from 'paho-mqtt'; // https://www.npmjs.com/package/paho-mqtt

const MINTOCKINTERVAL = 3 * 1000;
let lastMetricTick = new Date().getTime();
let lastTock = new Date().getTime();

/**
Expand Down Expand Up @@ -158,10 +157,6 @@ class MQTTWorker {
this.messageQueues[topicCategory] = [];
const now = new Date().getTime();
lastTock = now;
if (now - lastMetricTick > MINTOCKINTERVAL) {
console.log(`Worker batching ${batch.length} messages for ${topicCategory}`);
lastMetricTick = now;
}
return batch;
}

Expand Down

0 comments on commit c5d2e7f

Please sign in to comment.