InMemoryExporter
in package
implements
MetricExporterInterface, AggregationTemporalitySelectorInterface, PushMetricExporterInterface
FinalYes
Tags
Table of Contents
Interfaces
Properties
- $closed : bool
- $storage : ArrayObject
- $temporality : string|Temporality|null
Methods
- __construct() : mixed
- collect() : array<string|int, Metric>
- export() : bool
- forceFlush() : bool
- shutdown() : bool
- temporality() : string|Temporality|null
- Returns the temporality to use for the given metric.
Properties
$closed
private
bool
$closed
= false
$storage
private
ArrayObject
$storage
= new ArrayObject()
$temporality read-only
private
string|Temporality|null
$temporality
= null
Methods
__construct()
public
__construct([ArrayObject $storage = new ArrayObject() ][, string|Temporality|null $temporality = null ]) : mixed
Parameters
- $storage : ArrayObject = new ArrayObject()
- $temporality : string|Temporality|null = null
Tags
collect()
public
collect([bool $reset = false ]) : array<string|int, Metric>
Parameters
- $reset : bool = false
Return values
array<string|int, Metric>export()
public
export(iterable<string|int, mixed> $batch) : bool
Parameters
- $batch : iterable<string|int, mixed>
Return values
boolforceFlush()
public
forceFlush() : bool
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