diff --git a/src/lib/deltas.ts b/src/lib/deltas.ts index 20d542710..1dc9172f2 100644 --- a/src/lib/deltas.ts +++ b/src/lib/deltas.ts @@ -23,8 +23,12 @@ export type DeltasEvent = { filePath: string; }; -export const list = (params: { projectId: string; sessionId: string; paths?: string[] }) => - invoke>('list_deltas', params); +export const list = async (params: { projectId: string; sessionId: string; paths?: string[] }) => { + const start = performance.now(); + const result = await invoke>('list_deltas', params); + log.debug(`list_deltas took ${performance.now() - start}ms`); + return result; +}; export const subscribe = ( params: { projectId: string; sessionId: string }, diff --git a/src/lib/sessions.ts b/src/lib/sessions.ts index 996f37982..7b21811b0 100644 --- a/src/lib/sessions.ts +++ b/src/lib/sessions.ts @@ -29,10 +29,23 @@ export type Session = { activity: Activity[]; }; -export const listFiles = (params: { projectId: string; sessionId: string; paths?: string[] }) => - invoke>('list_session_files', params); +export const listFiles = async (params: { + projectId: string; + sessionId: string; + paths?: string[]; +}) => { + const start = performance.now(); + const result = await invoke>('list_session_files', params); + log.debug(`list_session_files took ${performance.now() - start}ms`); + return result; +}; -const list = (params: { projectId: string }) => invoke('list_sessions', params); +const list = async (params: { projectId: string }) => { + const start = performance.now(); + const result = await invoke('list_sessions', params); + log.debug(`list_sessions took ${performance.now() - start}ms`); + return result; +}; export default async (params: { projectId: string; earliestTimestampMs?: number }) => { const store = writable([] as Session[]);