Skip to content

Commit

Permalink
Address Eldad's Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PineappleIOnic committed May 10, 2024
1 parent 546d24b commit 04a0c97
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/Logger/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,20 @@ public static function hasProvider(string $providerName): bool
* @param float $sample Total percentage of issues to use with 100% being 1
* @return void
*/
public function sample(float $sample)
public function setSample(float $sample): self
{
$this->samplePercent = $sample * 100;

return $this;
}

/**
* Get the current sample value as a percentage
*
* @return float
*/
public function getSample(): float
{
return $this->samplePercent;
}
}
2 changes: 1 addition & 1 deletion tests/e2e/AdapterBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testSampler(): void
throw new \Exception('Log or adapter not set');
}
$logger = new Logger($this->adapter);
$logger->sample(0.1);
$logger->setSample(0.001);

$results = [];

Expand Down

0 comments on commit 04a0c97

Please sign in to comment.