diff --git a/README.md b/README.md index 0a7d9b6..79c89ba 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Features - [ ] Backoff - [ ] TLS - [ ] Snappy -- [ ] Sampling +- [X] Sampling - [ ] AUTH Usage diff --git a/src/Connection.php b/src/Connection.php index 66b03ab..8f610c5 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -47,6 +47,7 @@ abstract class Connection string $hostname = null, string $userAgent = null, int $heartbeatInterval = null, + int $sampleRate = 0, ) { $this->address = $address; @@ -55,6 +56,7 @@ abstract class Connection 'hostname' => $hostname ?? (static fn (mixed $host): string => \is_string($host) ? $host : '')(gethostname()), 'user_agent' => $userAgent ?? 'nsqphp/'.InstalledVersions::getPrettyVersion('nsq/nsq'), 'heartbeat_interval' => $heartbeatInterval, + 'sample_rate' => $sampleRate, ]; $this->logger = $logger ?? new NullLogger();