23use Liuggio\StatsdClient\Entity\StatsdDataInterface;
24use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
58 StatsdDataFactoryInterface $factory,
61 $this->factory = $factory;
62 $this->prefix = rtrim( $prefix,
'.' );
69 private function addPrefixToKey( $key ) {
70 return $this->prefix .
'.' . $key;
73 public function timing( $key, $time ) {
74 return $this->factory->timing( $this->addPrefixToKey( $key ), $time );
77 public function gauge( $key, $value ) {
78 return $this->factory->gauge( $this->addPrefixToKey( $key ), $value );
81 public function set( $key, $value ) {
82 return $this->factory->set( $this->addPrefixToKey( $key ), $value );
86 return $this->factory->increment( $this->addPrefixToKey( $key ) );
90 return $this->factory->decrement( $this->addPrefixToKey( $key ) );
94 return $this->factory->updateCount( $this->addPrefixToKey( $key ), $delta );
100 $metric = StatsdDataInterface::STATSD_METRIC_COUNT
102 return $this->factory->produceStatsdData(
103 $this->addPrefixToKey( $key ),
111class_alias( PrefixingStatsdDataFactoryProxy::class,
'PrefixingStatsdDataFactoryProxy' );