* Sets sampling rate for all items in $data.
* The sample rate specified in a StatsdData entity overrides the sample rate specified here.
*
- * {@inheritDoc}
+ * @inheritDoc
*/
public function appendSampleRate( $data, $sampleRate = 1 ) {
$samplingRates = $this->samplingRates;
$samplingRates = [ '*' => $sampleRate ];
}
if ( $samplingRates ) {
- array_walk( $data, function( $item ) use ( $samplingRates ) {
+ array_walk( $data, function ( $item ) use ( $samplingRates ) {
/** @var $item StatsdData */
foreach ( $samplingRates as $pattern => $rate ) {
if ( fnmatch( $pattern, $item->getKey(), FNM_NOESCAPE ) ) {
* strings are not allowed here as sampleData requires a StatsdDataInterface
* @param int $sampleRate
*
- * @return integer the data sent in bytes
+ * @return int the data sent in bytes
*/
public function send( $data, $sampleRate = 1 ) {
if ( !is_array( $data ) ) {
}
/**
- * {@inheritDoc}
+ * @inheritDoc
*/
protected function throwException( Exception $exception ) {
if ( !$this->getFailSilently() ) {