LateBindingMeter
    
            
            in package
            
        
    
            
            implements
                            MeterInterface                    
    
    
Tags
Table of Contents
Interfaces
Properties
- $factory : Closure
- $meter : MeterInterface|null
Methods
- __construct() : mixed
- batchObserve() : ObservableCallbackInterface
- Reports measurements for multiple asynchronous instrument from a single callback.
- createCounter() : CounterInterface
- Creates a `Counter`.
- createGauge() : GaugeInterface
- Creates a `Gauge`.
- createHistogram() : HistogramInterface
- Creates a `Histogram`.
- createObservableCounter() : ObservableCounterInterface
- Creates an `ObservableCounter`.
- createObservableGauge() : ObservableGaugeInterface
- Creates an `ObservableGauge`.
- createObservableUpDownCounter() : ObservableUpDownCounterInterface
- Creates an `ObservableUpDownCounter`.
- createUpDownCounter() : UpDownCounterInterface
- Creates an `UpDownCounter`.
Properties
$factory read-only
        private
            Closure
    $factory
    
    
    
    
    
    
$meter
        private
            MeterInterface|null
    $meter
     = null
    
    
    
    
    
Methods
__construct()
    public
                    __construct(callable(): MeterInterface $factory) : mixed
    Parameters
- $factory : callable(): MeterInterface
batchObserve()
Reports measurements for multiple asynchronous instrument from a single callback.
    public
                    batchObserve(callable $callback, AsynchronousInstrument $instrument, AsynchronousInstrument ...$instruments) : ObservableCallbackInterface
    The callback receives an for each instrument. All provided instruments have to be created by this meter.
$callback = $meter->batchObserve(
    function(
        ObserverInterface $usageObserver,
        ObserverInterface $pressureObserver,
    ): void {
        [$usage, $pressure] = expensive_system_call();
        $usageObserver->observe($usage);
        $pressureObserver->observe($pressure);
    },
    $meter->createObservableCounter('usage', description: 'count of items used'),
    $meter->createObservableGauge('pressure', description: 'force per unit area'),
);
Parameters
- $callback : callable
- 
                    function responsible for reporting the measurements 
- $instrument : AsynchronousInstrument
- 
                    first instrument to report measurements for 
- $instruments : AsynchronousInstrument
- 
                    additional instruments to report measurements for 
Attributes
- #[Override]
Return values
ObservableCallbackInterface —token to detach callback
createCounter()
Creates a `Counter`.
    public
                    createCounter(string $name[, string|null $unit = null ][, string|null $description = null ][, array<string|int, mixed> $advisory = [] ]) : CounterInterface
    Parameters
- $name : string
- 
                    name of the instrument 
- $unit : string|null = null
- 
                    unit of measure 
- $description : string|null = null
- 
                    description of the instrument 
- $advisory : array<string|int, mixed> = []
- 
                    an optional set of recommendations 
Attributes
- #[Override]
Return values
CounterInterface —created instrument
createGauge()
Creates a `Gauge`.
    public
                    createGauge(string $name[, string|null $unit = null ][, string|null $description = null ][, array<string|int, mixed> $advisory = [] ]) : GaugeInterface
    Parameters
- $name : string
- 
                    name of the instrument 
- $unit : string|null = null
- 
                    unit of measure 
- $description : string|null = null
- 
                    description of the instrument 
- $advisory : array<string|int, mixed> = []
- 
                    an optional set of recommendations 
Attributes
- #[Override]
Return values
GaugeInterface —created instrument
createHistogram()
Creates a `Histogram`.
    public
                    createHistogram(string $name[, string|null $unit = null ][, string|null $description = null ][, array<string|int, mixed> $advisory = [] ]) : HistogramInterface
    Parameters
- $name : string
- 
                    name of the instrument 
- $unit : string|null = null
- 
                    unit of measure 
- $description : string|null = null
- 
                    description of the instrument 
- $advisory : array<string|int, mixed> = []
- 
                    an optional set of recommendations, e.g. ['ExplicitBucketBoundaries' => [0.25, 0.5, 1, 5]]
Attributes
- #[Override]
Return values
HistogramInterface —created instrument
createObservableCounter()
Creates an `ObservableCounter`.
    public
                    createObservableCounter(string $name[, string|null $unit = null ][, string|null $description = null ][, callable|array<string|int, mixed> $advisory = [] ], callable ...$callbacks) : ObservableCounterInterface
    Parameters
- $name : string
- 
                    name of the instrument 
- $unit : string|null = null
- 
                    unit of measure 
- $description : string|null = null
- 
                    description of the instrument 
- $advisory : callable|array<string|int, mixed> = []
- 
                    an optional set of recommendations, or deprecated: the first callback to report measurements 
- $callbacks : callable
- 
                    responsible for reporting measurements 
Attributes
- #[Override]
Return values
ObservableCounterInterface —created instrument
createObservableGauge()
Creates an `ObservableGauge`.
    public
                    createObservableGauge(string $name[, string|null $unit = null ][, string|null $description = null ][, callable|array<string|int, mixed> $advisory = [] ], callable ...$callbacks) : ObservableGaugeInterface
    Parameters
- $name : string
- 
                    name of the instrument 
- $unit : string|null = null
- 
                    unit of measure 
- $description : string|null = null
- 
                    description of the instrument 
- $advisory : callable|array<string|int, mixed> = []
- 
                    an optional set of recommendations, or deprecated: the first callback to report measurements 
- $callbacks : callable
- 
                    responsible for reporting measurements 
Attributes
- #[Override]
Return values
ObservableGaugeInterface —created instrument
createObservableUpDownCounter()
Creates an `ObservableUpDownCounter`.
    public
                    createObservableUpDownCounter(string $name[, string|null $unit = null ][, string|null $description = null ][, callable|array<string|int, mixed> $advisory = [] ], callable ...$callbacks) : ObservableUpDownCounterInterface
    Parameters
- $name : string
- 
                    name of the instrument 
- $unit : string|null = null
- 
                    unit of measure 
- $description : string|null = null
- 
                    description of the instrument 
- $advisory : callable|array<string|int, mixed> = []
- 
                    an optional set of recommendations, or deprecated: the first callback to report measurements 
- $callbacks : callable
- 
                    responsible for reporting measurements 
Attributes
- #[Override]
Return values
ObservableUpDownCounterInterface —created instrument
createUpDownCounter()
Creates an `UpDownCounter`.
    public
                    createUpDownCounter(string $name[, string|null $unit = null ][, string|null $description = null ][, array<string|int, mixed> $advisory = [] ]) : UpDownCounterInterface
    Parameters
- $name : string
- 
                    name of the instrument 
- $unit : string|null = null
- 
                    unit of measure 
- $description : string|null = null
- 
                    description of the instrument 
- $advisory : array<string|int, mixed> = []
- 
                    an optional set of recommendations 
Attributes
- #[Override]
Return values
UpDownCounterInterface —created instrument