Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 314e7ab

Browse files
committed
refactor: typescript doc rewrited
1 parent aa307a2 commit 314e7ab

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

  • packages/opencensus-core/src/trace/sampler

packages/opencensus-core/src/trace/sampler/sampler.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const MIN_NUMBER = 1e-4;
2121
const MAX_NUMBER = 0xffffffffffffffff;
2222

2323
/**
24-
* Class Sampler
24+
* This class represent the probability of a tracer.
2525
*/
2626
export class Sampler {
2727
traceId: string;
@@ -39,7 +39,7 @@ export class Sampler {
3939
}
4040

4141
/**
42-
* Set idUpperBound with MAX_NUMBER
42+
* Set idUpperBound with MAX_NUMBER that is equivalent the probability be 1
4343
* @returns a Sampler object
4444
*/
4545
always(): Sampler {
@@ -48,7 +48,7 @@ export class Sampler {
4848
}
4949

5050
/**
51-
* Set idUpperBound with MIN_NUMBER
51+
* Set idUpperBound with MIN_NUMBER that is equivalent the probability be 0
5252
* @returns a Sampler object
5353
*/
5454
never(): Sampler {
@@ -76,9 +76,10 @@ export class Sampler {
7676
}
7777

7878
/**
79-
*
80-
* @param traceId
81-
* @returns a boolean
79+
* Checks if trace belong the sample.
80+
* @param traceId Used to check the probability
81+
* @returns a boolean. True if the traceId is in probability
82+
* False if the traceId is not in probability.
8283
*/
8384
shouldSample(traceId: string): boolean {
8485
const LOWER_BYTES = traceId.substring(16);

0 commit comments

Comments
 (0)