function DeltaStorage::add
File
-
vendor/
open-telemetry/ sdk/ Metrics/ Stream/ DeltaStorage.php, line 27
Class
- DeltaStorage
- @internal @phan-file-suppress PhanUndeclaredTypeParameter, PhanUndeclaredTypeProperty
Namespace
OpenTelemetry\SDK\Metrics\StreamCode
public function add(Metric $metric, int|GMP $readers) : void {
/** @phpstan-ignore-next-line */
if ($readers == 0) {
return;
}
if (($this->head->prev->readers ?? null) != $readers) {
$this->head->prev = new Delta($metric, $readers, $this->head->prev);
}
else {
assert($this->head->prev !== null);
$this->mergeInto($this->head->prev->metric, $metric);
}
}