Skip to content

Commit

Permalink
Stats: allow floats to be provided to CounterMetric->incrementBy()
Browse files Browse the repository at this point in the history
Floats are allowable values in addition to integers.

Bug: T348795
Change-Id: Ic1d6bcd312c9a3a834a0537b50c0d614a8d646e2
  • Loading branch information
shdubsh committed Oct 12, 2023
1 parent f6e98ba commit d655d80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/libs/Stats/Metrics/CounterMetric.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ public function increment(): void {
/**
* Increments metric by provided value.
*
* @param int $value
* @param float $value
* @return void
*/
public function incrementBy( int $value ): void {
public function incrementBy( float $value ): void {
if ( $this->statsdNamespace !== null ) {
$this->baseMetric->getStatsdDataFactory()->updateCount( $this->statsdNamespace, $value );
$this->statsdNamespace = null;
Expand Down

0 comments on commit d655d80

Please sign in to comment.