Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Probing #652

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ Stops the appmetrics monitoring agent. If the agent is not running this function

### appmetrics.enable(`type`, `config`)
Enable data generation of the specified data type. Cannot be called until the agent has been started by calling `start()` or `monitor()`.
* `type` (String) the type of event to start generating data for. Values of `eventloop`, `profiling`, `http`, `http-outbound`, `mongo`, `socketio`, `mqlight`, `postgresql`, `mqtt`, `mysql`, `redis`, `riak`, `memcached`, `oracledb`, `oracle`, `strong-oracle`, `requests` and `trace` are currently supported. As `trace` is added to request data, both `requests` and `trace` must be enabled in order to receive trace data.
* `type` (String) the type of event to start generating data for. Values of `eventloop`, `profiling`, `http`, `http-outbound`, `mongo`, `socket.io`, `mqlight`, `postgresql`, `mqtt`, `mysql`, `redis`, `riak`, `memcached`, `oracledb`, `oracle`, `strong-oracle`, `requests` and `trace` are currently supported. As `trace` is added to request data, both `requests` and `trace` must be enabled in order to receive trace data.
* `config` (Object) (optional) configuration map to be added for the data type being enabled. (see *[setConfig](#appmetricssetconfigtype-config)*) for more information.

The following data types are disabled by default: `profiling`, `requests`, `trace`

### appmetrics.disable(`type`)
Disable data generation of the specified data type. Cannot be called until the agent has been started by calling `start()` or `monitor()`.
* `type` (String) the type of event to stop generating data for. Values of `eventloop`, `profiling`, `http`, `mongo`, `socketio`, `mqlight`, `postgresql`, `mqtt`, `mysql`, `redis`, `riak`, `memcached`, `oracledb`, `oracle`, `strong-oracle`, `requests` and `trace` are currently supported.
* `type` (String) the type of event to stop generating data for. Values of `eventloop`, `profiling`, `http`, `mongo`, `socket.io`, `mqlight`, `postgresql`, `mqtt`, `mysql`, `redis`, `riak`, `memcached`, `oracledb`, `oracle`, `strong-oracle`, `requests` and `trace` are currently supported.

### appmetrics.setConfig(`type`, `config`)
Set the configuration to be applied to a specific data type. The configuration available is specific to the data type.
Expand Down Expand Up @@ -386,8 +386,8 @@ Emitted when a Riak method is called using the `basho-riak-client` module.
* `query` (String) the query parameter used in the `mapReduce` method.
* `duration` (Number) the time taken in milliseconds.

### Event: 'socketio'
Emitted when WebSocket data is sent or received by the application using socketio.
### Event: 'socket.io'
Emitted when WebSocket data is sent or received by the application using socket.io.
* `data` (Object) the data from the socket.io request:
* `time` (Number) the milliseconds when the event occurred. This can be converted to a Date using `new Date(data.time)`.
* `method` (String) whether the event is a `broadcast` or `emit` from the application, or a `receive` from a client .
Expand All @@ -407,10 +407,10 @@ Emitted when a query is executed using the `strong-oracle` module.
Requests are a special type of event emitted by appmetrics. All the probes named above can also create request events if requests are enabled. However requests are nested within a root incoming request (usually http). Request events are disabled by default.
* `data` (Object) the data from the request:
* `time` (Number) the milliseconds when the request occurred. This can be converted to a Date using `new Date(data.time)`.
* `type` (String) The type of the request event. This is the name of the probe that sent the request data, e.g. `http`, `socketio` etc.
* `type` (String) The type of the request event. This is the name of the probe that sent the request data, e.g. `http`, `socket.io` etc.
* `name` (String) The name of the request event. This is the request task, eg. the url, or the method being used.
* `request` (Object) the detailed data for the root request event:
* `type` (String) The type of the request event. This is the name of the probe that sent the request data, e.g. `http`, `socketio` etc.
* `type` (String) The type of the request event. This is the name of the probe that sent the request data, e.g. `http`, `socket.io` etc.
* `name` (String) The name of the request event. This is the request task, eg. the url, or the method being used.
* `context` (Object) Additional context data (usually contains the same data as the associated non-request metric event).
* `stack` (String) An optional stack trace for the event call.
Expand Down
1 change: 1 addition & 0 deletions lib/probe.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Probe.prototype.enable = function() {
};

Probe.prototype.disable = function() {
_enabled = false;
this.metricsProbeStart = function() {};
this.metricsProbeEnd = function() {};
};
Expand Down