@opentelemetry/sdk-metrics
Version:
39 lines • 1.62 kB
TypeScript
import type { Attributes } from '@opentelemetry/api';
import type { InstrumentationScope } from '@opentelemetry/core';
export type Maybe<T> = T | undefined;
/**
* Converting the unordered attributes into unique identifier string.
* @param attributes user provided unordered Attributes.
*/
export declare function hashAttributes(attributes: Attributes): string;
/**
* Converting the instrumentation scope object to a unique identifier string.
* @param instrumentationScope
*/
export declare function instrumentationScopeId(instrumentationScope: InstrumentationScope): string;
/**
* Error that is thrown on timeouts.
*/
export declare class TimeoutError extends Error {
constructor(message?: string);
}
/**
* Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise
* rejects, and resolves if the specified promise resolves.
*
* <p> NOTE: this operation will continue even after it throws a {@link TimeoutError}.
*
* @param promise promise to use with timeout.
* @param timeout the timeout in milliseconds until the returned promise is rejected.
*/
export declare function callWithTimeout<T>(promise: Promise<T>, timeout: number): Promise<T>;
export declare function setEquals(lhs: Set<unknown>, rhs: Set<unknown>): boolean;
/**
* Binary search the sorted array to the find upper bound for the value.
* @param arr
* @param value
* @returns
*/
export declare function binarySearchUB(arr: number[], value: number): number;
export declare function equalsCaseInsensitive(lhs: string, rhs: string): boolean;
//# sourceMappingURL=utils.d.ts.map