UNPKG

1.61 kBTypeScriptView Raw
1/**
2 * Copyright 2018, OpenCensus Authors
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 */
16import * as defaultLogger from '../common/console-logger';
17import { Bucket } from './types';
18export declare class BucketBoundaries {
19 readonly buckets: Bucket[];
20 readonly bucketCounts: number[];
21 /** An object to log information to */
22 private logger;
23 constructor(boundaries: number[], logger?: typeof defaultLogger);
24 /**
25 * Gets bucket boundaries
26 */
27 getBoundaries(): Bucket[];
28 /**
29 * Gets initial bucket counts
30 */
31 getCounts(): number[];
32 /**
33 * Drops negative (BucketBounds) are currently not supported by
34 * any of the backends that OC supports
35 * @param bucketBoundaries a list with the bucket boundaries
36 */
37 private dropNegativeBucketBounds;
38 /**
39 * Gets initial list of bucket counters
40 * @param buckets Bucket boundaries
41 */
42 private getBucketCounts;
43 /**
44 * Checks boundaries order and duplicates
45 * @param current Boundary
46 * @param next Next boundary
47 */
48 private validateBoundary;
49}