InMemoryMetricsRecorder
in package
implements
MetricsRecorder
FinalYes
Keeps observations in process memory, for tests and diagnostics.
Series are keyed by recorder name plus the exact tag set, so counters and duration samples can be read back without an exporter.
Table of Contents
Interfaces
- MetricsRecorder
- Application-owned sink for process observations, with no exporter dependency.
Properties
- $counters : array<string, float>
- $histograms : array<string, array<int, float>>
Methods
- counter() : float
- histogram() : array<int, float>
- increment() : void
- record() : void
- key() : string
Properties
$counters
private
array<string, float>
$counters
= []
$histograms
private
array<string, array<int, float>>
$histograms
= []
Methods
counter()
public
counter(string $name[, array<string, string> $tags = [] ]) : float
Parameters
- $name : string
- $tags : array<string, string> = []
Return values
floathistogram()
public
histogram(string $name[, array<string, string> $tags = [] ]) : array<int, float>
Parameters
- $name : string
- $tags : array<string, string> = []
Return values
array<int, float>increment()
public
increment(string $name[, float $value = 1.0 ][, array<string|int, mixed> $tags = [] ]) : void
Parameters
- $name : string
- $value : float = 1.0
- $tags : array<string|int, mixed> = []
record()
public
record(string $name, float $value[, array<string|int, mixed> $tags = [] ]) : void
Parameters
- $name : string
- $value : float
- $tags : array<string|int, mixed> = []
key()
private
static key(string $name, array<string, string> $tags) : string
Parameters
- $name : string
- $tags : array<string, string>