import { type LogEntry } from '@dxos/protocols/proto/dxos/client/services'; import { type Metric, type Resource } from '@dxos/protocols/proto/dxos/tracing'; import type { AddLinkOptions } from './api'; import { DiagnosticsManager } from './diagnostic'; import { DiagnosticsChannel } from './diagnostics-channel'; import { RemoteMetrics } from './remote/metrics'; import type { TracingBackend } from './tracing-types'; export type Diagnostics = { resources: Record; logs: LogEntry[]; }; export type TraceResourceConstructorProps = { constructor: { new (...args: any[]): {}; }; instance: any; annotation?: symbol; }; export declare class ResourceEntry { readonly data: Resource; readonly instance: WeakRef; readonly annotation?: symbol | undefined; /** * Sometimes bundlers mangle class names: WebFile -> WebFile2. * * We use a heuristic to remove the suffix. */ readonly sanitizedClassName: string; constructor(data: Resource, instance: WeakRef, annotation?: symbol | undefined); getMetric(name: string): Metric | undefined; } export declare class TraceProcessor { #private; readonly diagnostics: DiagnosticsManager; readonly diagnosticsChannel: DiagnosticsChannel; readonly remoteMetrics: RemoteMetrics; /** * Tracing backend. Initially a buffering backend that records spans; * once the observability package sets a real backend, the buffer is drained * and a thin translating wrapper is installed that resolves stale buffered * parent IDs still held by in-flight {@link Context} objects. * * The wrapper only allocates when a `buffered-*` parent is actually encountered; * the common path is a single `startsWith` check and direct passthrough. */ get tracingBackend(): TracingBackend; set tracingBackend(backend: TracingBackend | undefined); readonly resources: Map; readonly resourceInstanceIndex: WeakMap; readonly resourceIdList: number[]; readonly logs: LogEntry[]; private _instanceTag; constructor(); setInstanceTag(tag: string): void; addLink(parent: any, child: any, opts: AddLinkOptions): void; getDiagnostics(): Diagnostics; getResourceInfo(instance: any): Record; getResourceMetrics(instance: any): Metric[]; getResourceId(instance: any): number | null; findResourcesByClassName(className: string): ResourceEntry[]; findResourcesByAnnotation(annotation: symbol): ResourceEntry[]; refresh(): void; private _clearResources; private _pushLog; private _logProcessor; } export declare const TRACE_PROCESSOR: TraceProcessor; export declare const sanitizeClassName: (className: string) => string; //# sourceMappingURL=trace-processor.d.ts.map