InMemoryExporter
in package
implements
MetricExporterInterface, AggregationTemporalitySelectorInterface
FinalYes
Tags
Table of Contents
Interfaces
Properties
- $closed : bool
- $metrics : array<int, Metric>
- $temporality : string|Temporality|null
Methods
- __construct() : mixed
- collect() : array<int, Metric>
- export() : bool
- shutdown() : bool
- temporality() : string|Temporality|null
- Returns the temporality to use for the given metric.
Properties
$closed
private
bool
$closed
= false
$metrics
private
array<int, Metric>
$metrics
= []
$temporality read-only
private
string|Temporality|null
$temporality
= null
Methods
__construct()
public
__construct([string|Temporality|null $temporality = null ]) : mixed
Parameters
- $temporality : string|Temporality|null = null
collect()
public
collect([bool $reset = false ]) : array<int, Metric>
Parameters
- $reset : bool = false
Return values
array<int, Metric>export()
public
export(iterable<string|int, mixed> $batch) : bool
Parameters
- $batch : iterable<string|int, mixed>
Return values
boolshutdown()
public
shutdown() : bool
Return values
booltemporality()
Returns the temporality to use for the given metric.
public
temporality(MetricMetadataInterface $metric) : string|Temporality|null
It is recommended to return MetricMetadataInterface::temporality() if the exporter does not require a specific temporality.
Parameters
- $metric : MetricMetadataInterface
Return values
string|Temporality|null —temporality to use, or null to signal that the given metric should not be exported by this exporter