Sampling
This commit is contained in:
@ -35,7 +35,7 @@ Features
|
|||||||
- [ ] Backoff
|
- [ ] Backoff
|
||||||
- [ ] TLS
|
- [ ] TLS
|
||||||
- [ ] Snappy
|
- [ ] Snappy
|
||||||
- [ ] Sampling
|
- [X] Sampling
|
||||||
- [ ] AUTH
|
- [ ] AUTH
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
|
@ -47,6 +47,7 @@ abstract class Connection
|
|||||||
string $hostname = null,
|
string $hostname = null,
|
||||||
string $userAgent = null,
|
string $userAgent = null,
|
||||||
int $heartbeatInterval = null,
|
int $heartbeatInterval = null,
|
||||||
|
int $sampleRate = 0,
|
||||||
) {
|
) {
|
||||||
$this->address = $address;
|
$this->address = $address;
|
||||||
|
|
||||||
@ -55,6 +56,7 @@ abstract class Connection
|
|||||||
'hostname' => $hostname ?? (static fn (mixed $host): string => \is_string($host) ? $host : '')(gethostname()),
|
'hostname' => $hostname ?? (static fn (mixed $host): string => \is_string($host) ? $host : '')(gethostname()),
|
||||||
'user_agent' => $userAgent ?? 'nsqphp/'.InstalledVersions::getPrettyVersion('nsq/nsq'),
|
'user_agent' => $userAgent ?? 'nsqphp/'.InstalledVersions::getPrettyVersion('nsq/nsq'),
|
||||||
'heartbeat_interval' => $heartbeatInterval,
|
'heartbeat_interval' => $heartbeatInterval,
|
||||||
|
'sample_rate' => $sampleRate,
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->logger = $logger ?? new NullLogger();
|
$this->logger = $logger ?? new NullLogger();
|
||||||
|
Reference in New Issue
Block a user