Skip to content

Commit

Permalink
docs: add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerchi committed Mar 27, 2022
1 parent 8ff5a22 commit 5b0cad0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/constructs/sampling-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export class SamplingRule extends Rule {
if (percentage >= 1 || percentage <= 0) {
throw new Error('Percentage must be between 0 and 1');
}
// Get the first three significant hex digits from the percentage
const hexString = percentage.toString(16).slice(0, 5).slice(-3);

// Build up list of prefixes, starting from most significant digit
let prefixes: string[] = [];
let a;
for (a = 0x0; a < parseInt(hexString[0], 16); a++) {
Expand Down

0 comments on commit 5b0cad0

Please sign in to comment.