BatchingMetricProcessor implements MetricProcessor
FinalYes
Interfaces
Methods
- __construct() : mixed
- flush() : bool
- Export all pending metrics.
- process() : void
- Process a metric measurement.
- shutdown() : void
- Shutdown the processor.
Methods
__construct()
public
__construct(Exporter $exporter[, int $batchSize = 512 ][, ErrorHandler $errorHandler = new ErrorLogHandler() ][, float|null $maxBatchAgeSeconds = null ]) : mixed
Parameters
- $exporter : Exporter
- $batchSize : int = 512
- $errorHandler : ErrorHandler = new ErrorLogHandler()
- $maxBatchAgeSeconds : float|null = null
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
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
shutdown()
Shutdown the processor.
public
shutdown() : void
Implementations SHOULD flush() pending data before delegating shutdown to the underlying exporter. MUST be idempotent and MUST NOT throw.