ConsoleMetricExporter implements MetricExporter
Read onlyYes
FinalYes
Console exporter for metrics with ASCII table visualization.
Outputs metrics to the console in a human-readable format with optional ANSI colors. Table width is calculated dynamically based on content.
Interfaces
- MetricExporter
- Interface for exporting metrics to external systems.
Methods
- __construct() : mixed
- export() : bool
- Export a batch of metrics.
- transports() : array<string|int, Transport>
- Get the transports used by this exporter.
Methods
__construct()
public
__construct([bool $colors = true ][, null|resource $outputStream = null ]) : mixed
Parameters
- $colors : bool = true
-
Whether to use ANSI colors
- $outputStream : null|resource = null
-
Output stream (default: STDOUT)
export()
Export a batch of metrics.
public
export(array<string|int, Metric> $metrics) : bool
Parameters
- $metrics : array<string|int, Metric>
Return values
bool —True on success, false on failure
transports()
Get the transports used by this exporter.
public
transports() : array<string|int, Transport>