Skip to content

Commit

Permalink
diagnostics_channel: built-in channels should remain experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Belanger committed Nov 14, 2022
1 parent 916af4e commit d6a71bc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/api/diagnostics_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,12 @@ channel.unsubscribe(onMessage);

### Built-in Channels

> Stability: 1 - Experimental
While the diagnostics\_channel API is now considered stable, the built-in
channels currently available are not. Each channel must be declared stable
independently.

#### HTTP

`http.client.request.start`
Expand Down
11 changes: 11 additions & 0 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,17 @@ void Initialize(Local<Object> target,

READONLY_PROPERTY(constants, "measureMemory", measure_memory);

Local<Object> loop_mode = Object::New(env->isolate());
{
uv_run_mode DEFAULT = UV_RUN_DEFAULT;
uv_run_mode ONCE = UV_RUN_ONCE;
uv_run_mode NOWAIT = UV_RUN_NOWAIT;
NODE_DEFINE_CONSTANT(loop_mode, DEFAULT);
NODE_DEFINE_CONSTANT(loop_mode, ONCE);
NODE_DEFINE_CONSTANT(loop_mode, NOWAIT);
READONLY_PROPERTY(constants, "loopMode", loop_mode);
}

target->Set(context, env->constants_string(), constants).Check();

SetMethod(context, target, "measureMemory", MeasureMemory);
Expand Down

0 comments on commit d6a71bc

Please sign in to comment.