incrementBy( 1 ); } /** * Increments metric by provided value. * * @param float $value * @return void */ public function incrementBy( float $value ): void { foreach ( $this->baseMetric->getStatsdNamespaces() as $namespace ) { $this->baseMetric->getStatsdDataFactory()->updateCount( $namespace, $value ); } try { $this->baseMetric->addSample( new Sample( $this->baseMetric->getLabelValues(), $value ) ); } catch ( IllegalOperationException $ex ) { // Log the condition and give the caller something that will absorb calls. trigger_error( $ex->getMessage(), E_USER_WARNING ); } } /** @inheritDoc */ public function getTypeIndicator(): string { return self::TYPE_INDICATOR; } }