mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-26 11:08:38 +03:00
log api call durations
This commit is contained in:
parent
29a546a301
commit
97bbb00142
@ -23,8 +23,12 @@ export type DeltasEvent = {
|
||||
filePath: string;
|
||||
};
|
||||
|
||||
export const list = (params: { projectId: string; sessionId: string; paths?: string[] }) =>
|
||||
invoke<Record<string, Delta[]>>('list_deltas', params);
|
||||
export const list = async (params: { projectId: string; sessionId: string; paths?: string[] }) => {
|
||||
const start = performance.now();
|
||||
const result = await invoke<Record<string, Delta[]>>('list_deltas', params);
|
||||
log.debug(`list_deltas took ${performance.now() - start}ms`);
|
||||
return result;
|
||||
};
|
||||
|
||||
export const subscribe = (
|
||||
params: { projectId: string; sessionId: string },
|
||||
|
@ -29,10 +29,23 @@ export type Session = {
|
||||
activity: Activity[];
|
||||
};
|
||||
|
||||
export const listFiles = (params: { projectId: string; sessionId: string; paths?: string[] }) =>
|
||||
invoke<Record<string, string>>('list_session_files', params);
|
||||
export const listFiles = async (params: {
|
||||
projectId: string;
|
||||
sessionId: string;
|
||||
paths?: string[];
|
||||
}) => {
|
||||
const start = performance.now();
|
||||
const result = await invoke<Record<string, string>>('list_session_files', params);
|
||||
log.debug(`list_session_files took ${performance.now() - start}ms`);
|
||||
return result;
|
||||
};
|
||||
|
||||
const list = (params: { projectId: string }) => invoke<Session[]>('list_sessions', params);
|
||||
const list = async (params: { projectId: string }) => {
|
||||
const start = performance.now();
|
||||
const result = await invoke<Session[]>('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[]);
|
||||
|
Loading…
Reference in New Issue
Block a user