|
1 | | -import {Exporter} from '../../exporters/types'; |
| 1 | +/** |
| 2 | + * Copyright 2018 Google Inc. All Rights Reserved. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | + import {Exporter} from '../../exporters/types'; |
2 | 18 | import {PluginNames} from '../instrumentation/types'; |
3 | 19 | import {Logger} from '../../common/types'; |
4 | 20 |
|
5 | | -/** This interface represent the probability of a tracer. */ |
6 | | -export interface Sampler { |
7 | | - /** |
8 | | - * Sets idUpperBound with MAX_NUMBER that is equivalent the probability be 1. |
9 | | - * @returns a Sampler object. |
10 | | - */ |
11 | | - always(): Sampler; |
12 | | - |
13 | | - /** |
14 | | - * Sets idUpperBound with MIN_NUMBER that is equivalent the probability be 0. |
15 | | - * @returns a Sampler object. |
16 | | - */ |
17 | | - never(): Sampler; |
18 | | - |
19 | | - /** |
20 | | - * Sets idUpperBound with the probability. If probability |
21 | | - * parameter is bigger then 1 set always. If probability parameter less |
22 | | - * than 0, set never. |
23 | | - * @param probability probability between 0 and 1. |
24 | | - * @returns a Sampler object. |
25 | | - */ |
26 | | - probability(probability: number): Sampler; |
27 | | - |
28 | | - /** |
29 | | - * Checks if trace belong the sample. |
30 | | - * @param traceId Used to check the probability. |
31 | | - * @returns a boolean. True if the traceId is in probability |
32 | | - * False if the traceId is not in probability. |
33 | | - */ |
34 | | - shouldSample(traceId: string): boolean; |
35 | | -} |
36 | | - |
37 | 21 | /** Interface configuration for a buffer. */ |
38 | 22 | export interface BufferConfig { |
39 | 23 | bufferSize?: number; |
|
0 commit comments