9use Liuggio\StatsdClient\Entity\StatsdDataInterface;
10use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
44 StatsdDataFactoryInterface $factory,
47 $this->factory = $factory;
48 $this->prefix = rtrim( $prefix,
'.' );
55 private function addPrefixToKey( $key ) {
56 return $this->prefix .
'.' . $key;
60 public function timing( $key, $time ) {
61 return $this->factory->timing( $this->addPrefixToKey( $key ), $time );
65 public function gauge( $key, $value ) {
66 return $this->factory->gauge( $this->addPrefixToKey( $key ), $value );
70 public function set( $key, $value ) {
71 return $this->factory->set( $this->addPrefixToKey( $key ), $value );
76 return $this->factory->increment( $this->addPrefixToKey( $key ) );
81 return $this->factory->decrement( $this->addPrefixToKey( $key ) );
86 return $this->factory->updateCount( $this->addPrefixToKey( $key ), $delta );
93 $metric = StatsdDataInterface::STATSD_METRIC_COUNT
95 return $this->factory->produceStatsdData(
96 $this->addPrefixToKey( $key ),
104class_alias( PrefixingStatsdDataFactoryProxy::class,
'PrefixingStatsdDataFactoryProxy' );