This repository was archived by the owner on Oct 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
packages/opencensus-core/src/trace/sampler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const MIN_NUMBER = 1e-4;
2121const MAX_NUMBER = 0xffffffffffffffff ;
2222
2323/**
24- * Class Sampler
24+ * This class represent the probability of a tracer.
2525 */
2626export 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 ) ;
You can’t perform that action at this time.
0 commit comments