diff --git a/src/classes/StatsD.class.php b/src/classes/StatsD.class.php index 958760e0..b419f8c8 100644 --- a/src/classes/StatsD.class.php +++ b/src/classes/StatsD.class.php @@ -251,24 +251,7 @@ public function setPivotValue($pivotValue) */ protected function getStatsPaths() { - return(array_values(array_filter(array($this->getStoreStatPath(), $this->getAggregateStatPath())))); - } - - /** - * @return null|string - */ - protected function getStoreStatPath() - { - $path = null; - if(isset($this->pivotValue)) - { - if(!empty($this->prefix)) - { - $path = $this->prefix . '.'; - } - $path .= STAT_CLASS . '.' . STAT_PIVOT_FIELD . '.' . $this->pivotValue; - } - return $path; + return array_values(array_filter([$this->getAggregateStatPath()])); } /** diff --git a/test/unit/mongo/MongoTripodDriverTest.php b/test/unit/mongo/MongoTripodDriverTest.php index 739a7ef8..b8c2933f 100755 --- a/test/unit/mongo/MongoTripodDriverTest.php +++ b/test/unit/mongo/MongoTripodDriverTest.php @@ -2048,8 +2048,7 @@ public function testStatsD() { ->method("send") ->with( array( - "myapp.tripod.MONGO_GET_ETAG"=>"1|c", - "myapp.tripod.group_by_db.tripod_php_testing.MONGO_GET_ETAG"=>"1|c" + "myapp.tripod.MONGO_GET_ETAG"=>"1|c" ) ); diff --git a/test/unit/mongo/MongoTripodStatTest.php b/test/unit/mongo/MongoTripodStatTest.php index b7b6af52..8a06a546 100644 --- a/test/unit/mongo/MongoTripodStatTest.php +++ b/test/unit/mongo/MongoTripodStatTest.php @@ -76,7 +76,6 @@ public function testStatsDIncrementWithPivotValueNoPrefix() ->method('send') ->with( array( - STAT_CLASS.'.'.STAT_PIVOT_FIELD.'.wibble.FOO.BAR'=>'1|c', STAT_CLASS.'.FOO.BAR'=>"1|c" ), 1 @@ -112,7 +111,6 @@ public function testStatsDIncrementWithPivotValueAndPrefix() ->method('send') ->with( array( - 'somePrefix.' . STAT_CLASS . '.' . STAT_PIVOT_FIELD . '.wibble.FOO.BAR'=>"5|c", 'somePrefix.' . STAT_CLASS.'.FOO.BAR'=>"5|c" ), 1 @@ -147,7 +145,6 @@ public function testStatsDTimerWithPivotValueNoPrefix() ->method('send') ->with( array( - STAT_CLASS . '.' . STAT_PIVOT_FIELD . '.wibble.FOO.BAR'=>array("1|c","1234|ms"), STAT_CLASS . '.FOO.BAR'=>array("1|c","1234|ms") ), 1 @@ -181,7 +178,6 @@ public function testStatsDTimerWithPrefixAndPivotValue() ->method('send') ->with( array( - 'somePrefix.' . STAT_CLASS . '.' . STAT_PIVOT_FIELD . '.wibble.FOO.BAR'=>array("1|c","4567|ms"), 'somePrefix.' . STAT_CLASS . '.FOO.BAR'=>array("1|c","4567|ms") ), 1 @@ -216,7 +212,6 @@ public function testStatsDGaugeWithPivotValueNoPrefix() ->method('send') ->with( array( - STAT_CLASS. '.' . STAT_PIVOT_FIELD .'.wibble.FOO.BAR'=>"xyz|g", STAT_CLASS.'.FOO.BAR'=>"xyz|g" ), 1 @@ -251,7 +246,6 @@ public function testStatsDGaugeWithPrefixAndPivotValue() ->method('send') ->with( array( - 'somePrefix.' . STAT_CLASS . '.' . STAT_PIVOT_FIELD . '.wibble.FOO.BAR'=>"abc|g", 'somePrefix.' . STAT_CLASS . '.FOO.BAR'=>"abc|g" ), 1 @@ -305,4 +299,4 @@ public function testPivotValueCannotContainConsecutiveDot() $stat = new \Tripod\StatsD('foo.bar', 4567); $stat->setPivotValue('some..value'); } -} \ No newline at end of file +}