log2trace-ui - v1.0.0-rc.9
    Preparing search index...

    Interface TraceStore

    The store. Create one per trace with createTraceStore.

    interface TraceStore {
        state: TraceState;
        collapseAll(options?: MutationOptions): void;
        derive<T>(selector: Selector<T>): T;
        expandAll(options?: MutationOptions): void;
        expandAncestors(id: string, options?: MutationOptions): void;
        flushSync(): void;
        setCollapsed(ids: Iterable<string>, options?: MutationOptions): void;
        setData(index: SpanIndex): void;
        setHover(
            ids: Iterable<string, any, any> | null,
            options?: TargetOptions,
        ): void;
        setMatched(ids: SpanSet | null, options?: MutationOptions): void;
        setPhase(phase: DataPhase, error?: string): void;
        setSelection(ids: Iterable<string>, options?: TargetOptions): void;
        setWindow(window: TimeWindow | null, options?: MutationOptions): void;
        subscribe(
            listener: (change: ChangeSet) => void,
            slices?: number,
        ): () => void;
        toggleCollapse(id: string, options?: MutationOptions): void;
        touch(slices: number, options?: MutationOptions): void;
    }
    Index

    Properties

    state: TraceState

    The current state; a different object after every change.

    Methods

    • The value of a selector for the current state, computed again only when a slice it depends on changed.

      Type Parameters

      • T

      Parameters

      Returns T

    • Deliver pending notifications now instead of waiting for the scheduler.

      Returns void

    • Make exactly these spans the collapsed ones. Spans without children are ignored.

      Parameters

      Returns void

    • Replace the data. Spans keep their selection and collapsed state when they still exist; hover, filter result and time window are reset. Setting the index that is already loaded only updates the phase.

      Parameters

      Returns void

    • Hover spans, or null for nothing.

      Parameters

      • ids: Iterable<string, any, any> | null
      • Optionaloptions: TargetOptions

      Returns void

    • Report loading or failure. The index stays as it was.

      Parameters

      Returns void

    • Select spans. Ids that are not in the trace are dropped; an empty list clears the selection.

      Parameters

      Returns void

    • Be called when any of the given slices change.

      Parameters

      • listener: (change: ChangeSet) => void

        Receives the merged changes of one tick. An exception it throws does not stop the other listeners; the first one is rethrown afterwards.

      • Optionalslices: number

        OR of the Slice bits of interest; defaults to all.

      Returns () => void

      A function that unsubscribes.

    • Collapse an expanded span or expand a collapsed one. Spans without children are ignored.

      Parameters

      Returns void