Skip to content

Make Probe.disable() clear the _enabled flag, and correct the socket.io probe name in the README - #663

Open
Megapixel99 wants to merge 3 commits into
RuntimeTools:masterfrom
Megapixel99:master
Open

Make Probe.disable() clear the _enabled flag, and correct the socket.io probe name in the README#663
Megapixel99 wants to merge 3 commits into
RuntimeTools:masterfrom
Megapixel99:master

Conversation

@Megapixel99

Copy link
Copy Markdown

Summary

Two small fixes:

  1. Probe.prototype.disable() stubbed out the metrics hooks but never cleared
    the _enabled flag those hooks are restored from, so a disabled probe could
    silently come back on.
  2. The README documents the socket.io probe as socketio, but the probe
    registers itself as socket.io, so the documented enable/disable value
    never matched.

1. lib/probe.jsdisable() leaves _enabled true

enable() and disable() are asymmetric:

Probe.prototype.enable = function() {
  _enabled = true;                              // sets the flag
  if (_started) { /* restore metricsProbeStart/End */ }
};

Probe.prototype.disable = function() {
                                                // never cleared the flag
  this.metricsProbeStart = function() {};
  this.metricsProbeEnd = function() {};
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant