UNPKG

@zendesk/retrace

Version:

define and capture Product Operation Traces along with computed metrics with an optional friendly React beacon API

23 lines (22 loc) 1.13 kB
import type { Span } from './spanTypes'; import type { RelationSchemasBase, TraceManagerUtilities } from './types'; export type TickListWithMeta<RelationSchemasT extends RelationSchemasBase<RelationSchemasT>> = Span<RelationSchemasT>[] & { tickCompleted?: boolean; }; export interface TickMeta<RelationSchemasT extends RelationSchemasBase<RelationSchemasT>> { /** * Array of all spans that were processed in the current event loop tick. * Empty if tick tracking is disabled */ spansInCurrentTick: TickListWithMeta<RelationSchemasT>; thisSpanInCurrentTickIndex: number; } /** symbol for storing the tick meta for starting of the span */ export declare const TICK_META: unique symbol; /** symbol for storing the tick meta for closing of the span */ export declare const TICK_META_END: unique symbol; export declare class TickParentResolver<const RelationSchemasT extends RelationSchemasBase<RelationSchemasT>> { #private; constructor(utilities: TraceManagerUtilities<RelationSchemasT>); addSpanToCurrentTick(span: Span<RelationSchemasT>, endingSpan?: boolean): TickMeta<RelationSchemasT>; }