Flow PHP

MemoryMetricProcessor implements MetricProcessor

FinalYes

Processor that stores metrics in memory and exports via configured exporter.

Interfaces

MetricProcessor
Interface for processing metric measurements.

Methods

__construct()  : mixed
countMetrics()  : int
Get the total number of recorded metrics.
exporter()  : MetricExporter
Get the exporter used by this processor.
flush()  : bool
Export all pending metrics.
metrics()  : array<string|int, Metric>
Get all recorded metrics.
metricsOfType()  : array<string|int, Metric>
Get all metrics of a specific type.
metricsWithName()  : array<string|int, Metric>
Get all metrics with a specific name.
process()  : void
Process a metric measurement.
reset()  : void
Reset all stored data.

Methods

countMetrics()

Get the total number of recorded metrics.

public countMetrics() : int
Return values
int

flush()

Export all pending metrics.

public flush() : bool

Forces immediate export of any buffered metrics.

Return values
bool

True if all metrics were successfully exported

metricsWithName()

Get all metrics with a specific name.

public metricsWithName(string $name) : array<string|int, Metric>
Parameters
$name : string
Return values
array<string|int, Metric>

process()

Process a metric measurement.

public process(Metric $metric) : void

This is invoked when an instrument records a value. The processor may buffer the metric, export it immediately, or discard it based on filtering rules.

Parameters
$metric : Metric

        
On this page

Search results