durable-actors-observer 0.14.7 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/DrawerContext.d.ts +15 -0
- package/dist/client/cacheKeys.d.ts +4 -0
- package/dist/client/observerClient.d.ts +13 -3
- package/dist/client/streams/logStream.d.ts +2 -0
- package/dist/components/instance/logChart.d.ts +10 -0
- package/dist/components/instance/logList.d.ts +16 -0
- package/dist/components/instance/logsCard.d.ts +12 -0
- package/dist/components/instance/requestDetails.d.ts +7 -0
- package/dist/components/instance/requestsCard.d.ts +2 -1
- package/dist/components/overview/requestCountCard.d.ts +1 -0
- package/dist/components/overview/requestRateCard.d.ts +0 -1
- package/dist/components/ui/drawer.d.ts +15 -0
- package/dist/components/ui/queueStripes.d.ts +2 -0
- package/dist/components/ui/sectionCard.d.ts +2 -1
- package/dist/components/ui/segmentedControl.d.ts +1 -0
- package/dist/format.d.ts +2 -0
- package/dist/hooks/useActorRequests.d.ts +13 -0
- package/dist/hooks/useDebouncedValue.d.ts +1 -0
- package/dist/hooks/useLogs.d.ts +10 -0
- package/dist/hooks/useWindowedSWR.d.ts +2 -0
- package/dist/index.js +2389 -1103
- package/dist/lib/logs.d.ts +28 -0
- package/dist/lib/requestStats.d.ts +6 -1
- package/dist/standalone/THIRD-PARTY-LICENSES.md +36 -0
- package/dist/standalone/app.css +1 -1
- package/dist/standalone/app.js +19 -16
- package/dist/theme.css +1 -1
- package/dist/types/Logs.d.ts +27 -0
- package/dist/types/Overview.d.ts +7 -0
- package/dist/types/Requests.d.ts +9 -0
- package/package.json +4 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type DrawerEntry = {
|
|
3
|
+
key: string;
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
type DrawerContextType = {
|
|
7
|
+
openKey: string | null;
|
|
8
|
+
show: (entry: DrawerEntry, trigger: HTMLElement) => void;
|
|
9
|
+
close: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function DrawerProvider({ children }: {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function useDrawer(): DrawerContextType;
|
|
15
|
+
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import type { LogFilter } from "../types/Logs.js";
|
|
1
2
|
export declare const actorsKey: (baseUrl: string) => readonly ["actors", string];
|
|
2
3
|
export declare const actorEventsKey: (baseUrl: string) => readonly ["actors/events", string];
|
|
3
4
|
export declare const requestsKey: (baseUrl: string) => readonly ["requests", string];
|
|
4
5
|
export declare const requestEventsKey: (baseUrl: string, durationMs: number) => readonly ["requests/events", string, number];
|
|
5
6
|
export declare const residencyKey: (baseUrl: string, actorName: string) => readonly ["residency", string, string];
|
|
6
7
|
export declare const webSocketsKey: (baseUrl: string) => readonly ["websockets", string];
|
|
8
|
+
export declare const logsKey: (baseUrl: string, { actorName, actorId, requestId, level, search }: LogFilter) => readonly ["logs", string, string, string, string | null, import("../types/Logs.js").LogLevel | null, string];
|
|
9
|
+
export declare const logHistogramKey: (baseUrl: string, { actorName, actorId, requestId, search }: LogFilter) => readonly ["logs/histogram", string, string, string, string | null, string];
|
|
10
|
+
export declare const logEventsKey: (baseUrl: string, filter: LogFilter) => readonly ["logs/events", ...(string | null)[]];
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
import type { ActorInventory } from "../types/Actors.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ActorLogPage, LogFilter, LogHistogram } from "../types/Logs.js";
|
|
3
|
+
import type { RequestHistoryQuery, RequestTrace, RequestTracePage } from "../types/Requests.js";
|
|
3
4
|
import type { ResidencyHistory } from "../types/Residency.js";
|
|
4
5
|
import type { SocketSession } from "../types/Sockets.js";
|
|
5
6
|
import type { TimeBounds } from "../types/TimeRange.js";
|
|
6
7
|
export declare const defaultBaseUrl = "/api/observe";
|
|
7
8
|
export interface ObserverClient {
|
|
8
9
|
listActorTypes(): Promise<ActorInventory>;
|
|
9
|
-
listRequests(
|
|
10
|
+
listRequests(query: RequestHistoryQuery): Promise<RequestTracePage>;
|
|
10
11
|
listResidency(actorName: string, bounds: TimeBounds): Promise<ResidencyHistory>;
|
|
11
12
|
listWebSockets(): Promise<SocketSession[]>;
|
|
13
|
+
listLogs(filter: LogFilter, bounds: TimeBounds, cursor: string | null): Promise<ActorLogPage>;
|
|
14
|
+
getLogHistogram(filter: LogFilter, bounds: TimeBounds, bucketMs: number): Promise<LogHistogram>;
|
|
12
15
|
}
|
|
13
16
|
export declare class HttpObserverClient implements ObserverClient {
|
|
14
17
|
private readonly baseUrl;
|
|
15
18
|
constructor(baseUrl?: string);
|
|
16
19
|
listActorTypes(): Promise<ActorInventory>;
|
|
17
|
-
listRequests({ fromMs, toMs }:
|
|
20
|
+
listRequests({ fromMs, toMs, limit, cursor, actorName, actorId }: RequestHistoryQuery): Promise<RequestTracePage>;
|
|
18
21
|
listResidency(actorName: string, { fromMs, toMs }: TimeBounds): Promise<ResidencyHistory>;
|
|
19
22
|
listWebSockets(): Promise<SocketSession[]>;
|
|
23
|
+
listLogs(filter: LogFilter, { fromMs, toMs }: TimeBounds, cursor: string | null): Promise<ActorLogPage>;
|
|
24
|
+
getLogHistogram(filter: LogFilter, { fromMs, toMs }: TimeBounds, bucketMs: number): Promise<LogHistogram>;
|
|
25
|
+
collectRequests(bounds: TimeBounds, filter?: {
|
|
26
|
+
actorName?: string;
|
|
27
|
+
actorId?: string;
|
|
28
|
+
}): Promise<RequestTrace[]>;
|
|
20
29
|
private get;
|
|
21
30
|
}
|
|
31
|
+
export declare function logFilterParams({ actorName, actorId, requestId, level, search }: LogFilter): URLSearchParams;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LogHistogram, LogLevel } from "../../types/Logs.js";
|
|
2
|
+
import type { TimeSpan } from "../../types/TimeRange.js";
|
|
3
|
+
export declare const levelFill: Record<LogLevel, string>;
|
|
4
|
+
export type LogChartProps = {
|
|
5
|
+
histogram: LogHistogram | undefined;
|
|
6
|
+
level: LogLevel | null;
|
|
7
|
+
live: boolean;
|
|
8
|
+
onZoom: (span: TimeSpan) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function LogChart({ histogram, level, live, onZoom }: LogChartProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ActorLog } from "../../types/Logs.js";
|
|
2
|
+
export type LogColumns = {
|
|
3
|
+
level: boolean;
|
|
4
|
+
request: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type LogListProps = {
|
|
7
|
+
lines: ActorLog[] | null;
|
|
8
|
+
failed: boolean;
|
|
9
|
+
search: string;
|
|
10
|
+
filtered: boolean;
|
|
11
|
+
onFilterRequest: (requestId: string) => void;
|
|
12
|
+
onClearFilters: () => void;
|
|
13
|
+
onReachEnd: (() => void) | undefined;
|
|
14
|
+
columns: LogColumns;
|
|
15
|
+
};
|
|
16
|
+
export declare function LogList({ lines, failed, search, filtered, onFilterRequest, onClearFilters, onReachEnd, columns }: LogListProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RequestTrace } from "../../types/Requests.js";
|
|
2
|
+
import type { TimeWindow } from "../../types/TimeRange.js";
|
|
3
|
+
export declare const logsCardId = "logs";
|
|
4
|
+
export type LogsCardProps = {
|
|
5
|
+
actorName: string;
|
|
6
|
+
actorId: string;
|
|
7
|
+
requests: RequestTrace[] | null;
|
|
8
|
+
requestId: string | null;
|
|
9
|
+
onRequestChange: (requestId: string | null) => void;
|
|
10
|
+
timeWindow: TimeWindow;
|
|
11
|
+
};
|
|
12
|
+
export declare function LogsCard({ actorName, actorId, requests, requestId, onRequestChange, timeWindow }: LogsCardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RequestTrace } from "../../types/Requests.js";
|
|
2
|
+
export type RequestDetailsProps = {
|
|
3
|
+
call: RequestTrace;
|
|
4
|
+
blocker: RequestTrace | undefined;
|
|
5
|
+
onShowLogs: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function RequestDetails({ call, blocker, onShowLogs }: RequestDetailsProps): import("react").JSX.Element;
|
|
@@ -4,5 +4,6 @@ export type RequestsCardProps = {
|
|
|
4
4
|
requests: RequestTrace[] | null;
|
|
5
5
|
failed: boolean;
|
|
6
6
|
timeWindow: TimeWindow;
|
|
7
|
+
onShowLogs: (requestId: string) => void;
|
|
7
8
|
};
|
|
8
|
-
export declare function RequestsCard({ requests, failed, timeWindow }: RequestsCardProps): import("react").JSX.Element;
|
|
9
|
+
export declare function RequestsCard({ requests, failed, timeWindow, onShowLogs }: RequestsCardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function RequestCountCard(): import("react").JSX.Element;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { RequestTrace } from "../../types/Requests.js";
|
|
2
2
|
import type { TimeWindow } from "../../types/TimeRange.js";
|
|
3
|
-
export declare function RequestRateCard(): import("react").JSX.Element;
|
|
4
3
|
export type RequestRateTrendProps = {
|
|
5
4
|
requests: RequestTrace[] | null;
|
|
6
5
|
failed: boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
3
|
+
declare function Drawer({ ...props }: ComponentProps<typeof DrawerPrimitive.Root>): import("react").JSX.Element;
|
|
4
|
+
declare function DrawerTrigger({ ...props }: ComponentProps<typeof DrawerPrimitive.Trigger>): import("react").JSX.Element;
|
|
5
|
+
declare function DrawerPortal({ ...props }: ComponentProps<typeof DrawerPrimitive.Portal>): import("react").JSX.Element;
|
|
6
|
+
declare function DrawerClose({ ...props }: ComponentProps<typeof DrawerPrimitive.Close>): import("react").JSX.Element;
|
|
7
|
+
declare function DrawerOverlay({ className, ...props }: ComponentProps<typeof DrawerPrimitive.Overlay>): import("react").JSX.Element;
|
|
8
|
+
declare function DrawerContent({ className, children, container, ...props }: ComponentProps<typeof DrawerPrimitive.Content> & {
|
|
9
|
+
container?: HTMLElement | null;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
declare function DrawerHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
12
|
+
declare function DrawerFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
13
|
+
declare function DrawerTitle({ className, ...props }: ComponentProps<typeof DrawerPrimitive.Title>): import("react").JSX.Element;
|
|
14
|
+
declare function DrawerDescription({ className, ...props }: ComponentProps<typeof DrawerPrimitive.Description>): import("react").JSX.Element;
|
|
15
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
export type SectionCardProps = {
|
|
3
|
+
id?: string;
|
|
3
4
|
title: string;
|
|
4
5
|
description?: ReactNode;
|
|
5
6
|
aside?: ReactNode;
|
|
@@ -7,4 +8,4 @@ export type SectionCardProps = {
|
|
|
7
8
|
className?: string;
|
|
8
9
|
children: ReactNode;
|
|
9
10
|
};
|
|
10
|
-
export declare function SectionCard({ title, description, aside, busy, className, children }: SectionCardProps): import("react").JSX.Element;
|
|
11
|
+
export declare function SectionCard({ id, title, description, aside, busy, className, children }: SectionCardProps): import("react").JSX.Element;
|
package/dist/format.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export declare const formatClock: (ms: number) => string;
|
|
2
2
|
export declare const formatPreciseClock: (ms: number) => string;
|
|
3
|
+
export declare const formatPreciseDateTime: (ms: number) => string;
|
|
3
4
|
export declare const formatTick: (ms: number, spanMs: number) => string;
|
|
4
5
|
export declare const formatTimeSpan: (fromMs: number, toMs: number) => string;
|
|
5
6
|
export declare const formatPreciseTimeSpan: (fromMs: number, toMs: number) => string;
|
|
7
|
+
export declare const formatLogClock: (ms: number) => string;
|
|
6
8
|
export declare const formatCount: (value: number) => string;
|
|
7
9
|
export declare const formatDecimal: (value: number) => string;
|
|
8
10
|
export declare const formatPercent: (ratio: number) => string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RequestTrace } from "../types/Requests.js";
|
|
2
|
+
export declare function useActorTypeRequests(actorName: string): {
|
|
3
|
+
requests: RequestTrace[] | null;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
isError: boolean;
|
|
6
|
+
error: any;
|
|
7
|
+
};
|
|
8
|
+
export declare function useInstanceRequests(actorName: string, actorId: string): {
|
|
9
|
+
requests: RequestTrace[] | null;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
isError: boolean;
|
|
12
|
+
error: any;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDebouncedValue<T>(value: T, delayMs: number): T;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ActorLog, ActorLogPage, LogFilter } from "../types/Logs.js";
|
|
2
|
+
import type { TimeWindow } from "../types/TimeRange.js";
|
|
3
|
+
export declare function useLogs(baseUrl: string, timeWindow: TimeWindow, filter: LogFilter): {
|
|
4
|
+
lines: ActorLog[] | null;
|
|
5
|
+
hasOlder: boolean;
|
|
6
|
+
loadingOlder: boolean;
|
|
7
|
+
loadOlder: () => Promise<ActorLogPage[] | undefined>;
|
|
8
|
+
histogram: import("../types/Logs.js").LogHistogram | undefined;
|
|
9
|
+
isError: boolean;
|
|
10
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { type SWRConfiguration } from "swr";
|
|
2
2
|
import type { TimeBounds, TimeWindow } from "../types/TimeRange.js";
|
|
3
3
|
export declare function useWindowedSWR<T>(key: readonly unknown[], timeWindow: TimeWindow, fetch: (bounds: TimeBounds) => Promise<T>, config?: SWRConfiguration<T>): import("swr").SWRResponse<T, any, SWRConfiguration<T, any, import("swr").BareFetcher<T>> | undefined>;
|
|
4
|
+
export declare function windowKey({ fromMs, toMs, live }: TimeWindow): readonly unknown[];
|
|
5
|
+
export declare function currentBounds({ fromMs, toMs, live }: TimeWindow): TimeBounds;
|