NoopMeterHandle
The disabled-state MeterHandle: every recording is a safe no-op.
A single shared instance is reused (NoopMeterHandle::instance()), same rationale as NoopSpanHandle.
Synopsis
Section titled “Synopsis”final class NoopMeterHandle implements MeterHandle
| Implements | MeterHandle |
| Source | Telemetry/NoopMeterHandle.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
| [`addCounter(string $name, int | float $increment = 1, array $attributes = []): void`](#addcounter) |
instance(): NoopMeterHandle | The shared no-op meter handle, created on first call and reused for the rest of the process. |
recordGauge(string $name, float $value, array $attributes = []): void | Discards the gauge measurement. |
recordHistogram(string $name, float $value, array $attributes = []): void | Discards the histogram measurement. |
addCounter()
Section titled “addCounter()”public function addCounter(string $name, int|float $increment = 1, array $attributes = []): void
Discards the counter increment.
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$increment | `int“ | “float` |
$attributes | array |
instance()
Section titled “instance()”public static function instance(): NoopMeterHandle
The shared no-op meter handle, created on first call and reused for the rest of the process.
Safe to hand out freely: it is stateless and every recording on it is discarded.
Returns NoopMeterHandle
recordGauge()
Section titled “recordGauge()”public function recordGauge(string $name, float $value, array $attributes = []): void
Discards the gauge measurement.
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$value | float | |
$attributes | array |
recordHistogram()
Section titled “recordHistogram()”public function recordHistogram(string $name, float $value, array $attributes = []): void
Discards the histogram measurement.
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$value | float | |
$attributes | array |