class RuntimeInstrumentation extends AbstractInstrumentation

Constants

protected MEMORY_METRICS

protected GARBAGE_COLLECTION_METRICS

protected CPU_METRICS

protected OPCACHE_METRICS

protected SERVER_METRICS

protected WORKER_METRICS

protected COROUTINE_METRICS

Properties

protected InstrumentationOptions $options from  AbstractInstrumentation

Methods

void
register(array $options)

Register the instrumentation with normalized options.

void
registerInstrumentation()

Register runtime instruments and collection callbacks.

bool
tracesEnabled()

Determine whether trace output is enabled.

bool
metricEnabled(string $name)

Determine whether a metric is enabled.

array
indexObservers(array $names, array $observers)

Index callback observers by their matching instrument name.

__construct(Container $container, MeterProviderInterface $meterProvider, ProcessIdentity $processIdentity)

Create runtime instrumentation.

array
enabledMetrics(array $names)

Return enabled names from one snapshot group.

void
registerBatch(MeterInterface $meter, array $names, Closure $callback)

Register one batched snapshot callback.

AsynchronousInstrument
createInstrument(MeterInterface $meter, string $name)

Create one observable runtime instrument.

void
observeMemory(array $observers)

Observe process memory metrics.

void
observeGarbageCollection(array $observers)

Observe garbage collection metrics.

void
observeCpu(array $observers)

Observe process CPU metrics.

void
observeOpcache(array $observers)

Observe shared OPcache metrics.

void
observeServer(Server $server, array $observers)

Observe shared server and current-worker metrics.

void
observeCoroutines(array $observers)

Observe current-worker coroutine metrics.

Details

final void register(array $options)

Register the instrumentation with normalized options.

Parameters

array $options

Return Value

void

at line 82
protected void registerInstrumentation()

Register runtime instruments and collection callbacks.

Return Value

void

protected bool tracesEnabled()

Determine whether trace output is enabled.

Return Value

bool

protected bool metricEnabled(string $name)

Determine whether a metric is enabled.

Parameters

string $name

Return Value

bool

protected array indexObservers(array $names, array $observers)

Index callback observers by their matching instrument name.

The SDK supplies observers in the same order as the instruments passed to batchObserve(), so the unchanged name order is the mapping contract.

Parameters

array $names
array $observers

Return Value

array

at line 72
__construct(Container $container, MeterProviderInterface $meterProvider, ProcessIdentity $processIdentity)

Create runtime instrumentation.

Parameters

Container $container
MeterProviderInterface $meterProvider
ProcessIdentity $processIdentity

at line 148
protected array enabledMetrics(array $names)

Return enabled names from one snapshot group.

Parameters

array $names

Return Value

array

at line 162
protected void registerBatch(MeterInterface $meter, array $names, Closure $callback)

Register one batched snapshot callback.

Parameters

MeterInterface $meter
array $names
Closure $callback

Return Value

void

at line 185
protected AsynchronousInstrument createInstrument(MeterInterface $meter, string $name)

Create one observable runtime instrument.

Parameters

MeterInterface $meter
string $name

Return Value

AsynchronousInstrument

at line 337
protected void observeMemory(array $observers)

Observe process memory metrics.

Parameters

array $observers

Return Value

void

at line 367
protected void observeGarbageCollection(array $observers)

Observe garbage collection metrics.

Parameters

array $observers

Return Value

void

at line 392
protected void observeCpu(array $observers)

Observe process CPU metrics.

Parameters

array $observers

Return Value

void

at line 439
protected void observeOpcache(array $observers)

Observe shared OPcache metrics.

Parameters

array $observers

Return Value

void

at line 471
protected void observeServer(Server $server, array $observers)

Observe shared server and current-worker metrics.

Parameters

Server $server
array $observers

Return Value

void

at line 496
protected void observeCoroutines(array $observers)

Observe current-worker coroutine metrics.

Parameters

array $observers

Return Value

void