From f5387106af411b728a90762db7365439a8085cc5 Mon Sep 17 00:00:00 2001 From: Tejas Kumar Date: Tue, 21 Nov 2023 11:45:13 +0100 Subject: [PATCH] Format --- web-client/src/lib/span/ipc-spans.ts | 58 ++++++++++++------------ web-client/src/lib/span/isIpcSpanName.ts | 4 +- web-client/src/lib/span/update-spans.ts | 22 +++++---- web-client/tailwind.config.ts | 2 +- 4 files changed, 44 insertions(+), 42 deletions(-) diff --git a/web-client/src/lib/span/ipc-spans.ts b/web-client/src/lib/span/ipc-spans.ts index a5adbe84..354e9b9f 100644 --- a/web-client/src/lib/span/ipc-spans.ts +++ b/web-client/src/lib/span/ipc-spans.ts @@ -1,34 +1,34 @@ export type IpcSpanName = - /* tracks the whole duration of a req. fields: id = invoke ID and kind = "postmessage" */ - | "ipc::request" - /* = the time it takes to deserialize the arguments. fields: id = invoke ID and args = string repo of the unparsed data */ - | "ipc::request::deserialize_arg" - /* this gets emitted when we have found the right handler and are processing the request. fields: id= Invoke ID, cmd = the command name, kind the kind of command, loc.line the source code line of the handler, loc.col the source code column of the handler, is_internal = whether the command is internal to tauri or user defined */ - | "ipc::request::handler" - /* this tracks the duration of the user written code that handles the request */ - | "ipc::request::run" - /* tracks how much time it took to respond to the request (from the rust side) */ - | "ipc::request::respond" - /* shows the actual response */ - | "ipc::request::response" - /* @todo describe 👇 */ - | "wry::eval"; + /* tracks the whole duration of a req. fields: id = invoke ID and kind = "postmessage" */ + | "ipc::request" + /* = the time it takes to deserialize the arguments. fields: id = invoke ID and args = string repo of the unparsed data */ + | "ipc::request::deserialize_arg" + /* this gets emitted when we have found the right handler and are processing the request. fields: id= Invoke ID, cmd = the command name, kind the kind of command, loc.line the source code line of the handler, loc.col the source code column of the handler, is_internal = whether the command is internal to tauri or user defined */ + | "ipc::request::handler" + /* this tracks the duration of the user written code that handles the request */ + | "ipc::request::run" + /* tracks how much time it took to respond to the request (from the rust side) */ + | "ipc::request::respond" + /* shows the actual response */ + | "ipc::request::response" + /* @todo describe 👇 */ + | "wry::eval"; export const ipcSpans: IpcSpanName[] = [ - "ipc::request", - "ipc::request::deserialize_arg", - "ipc::request::run", - "ipc::request::respond", - "ipc::request::response", - "wry::eval", -] + "ipc::request", + "ipc::request::deserialize_arg", + "ipc::request::run", + "ipc::request::respond", + "ipc::request::response", + "wry::eval", +]; export const ipcSpanNameMap: Record = { - "ipc::request": "Request", - "ipc::request::run": "Command Run", - "ipc::request::respond": "Response", - "wry::eval": "Eval Response", - "ipc::request::deserialize_arg": "Deserialize Args", - "ipc::request::handler": "Command Handler", - "ipc::request::response": "Response", -}; \ No newline at end of file + "ipc::request": "Request", + "ipc::request::run": "Command Run", + "ipc::request::respond": "Response", + "wry::eval": "Eval Response", + "ipc::request::deserialize_arg": "Deserialize Args", + "ipc::request::handler": "Command Handler", + "ipc::request::response": "Response", +}; diff --git a/web-client/src/lib/span/isIpcSpanName.ts b/web-client/src/lib/span/isIpcSpanName.ts index 82727a55..18ec49de 100644 --- a/web-client/src/lib/span/isIpcSpanName.ts +++ b/web-client/src/lib/span/isIpcSpanName.ts @@ -1,5 +1,5 @@ import { IpcSpanName, ipcSpans } from "./ipc-spans"; export const isIpcSpanName = (name: string): name is IpcSpanName => { - return ipcSpans.includes(name as unknown as IpcSpanName); -} \ No newline at end of file + return ipcSpans.includes(name as unknown as IpcSpanName); +}; diff --git a/web-client/src/lib/span/update-spans.ts b/web-client/src/lib/span/update-spans.ts index fa9d567c..97d5fbe5 100644 --- a/web-client/src/lib/span/update-spans.ts +++ b/web-client/src/lib/span/update-spans.ts @@ -11,7 +11,9 @@ export function updatedSpans(currentSpans: Span[], spanEvents: SpanEvent[]) { parentId: event.event.newSpan.parent, metadataId: event.event.newSpan.metadataId, fields: event.event.newSpan.fields, - createdAt: event.event.newSpan.at ? convertTimestampToNanoseconds(event.event.newSpan.at) : -1, + createdAt: event.event.newSpan.at + ? convertTimestampToNanoseconds(event.event.newSpan.at) + : -1, enters: [], exits: [], closedAt: -1, @@ -25,9 +27,9 @@ export function updatedSpans(currentSpans: Span[], spanEvents: SpanEvent[]) { case "enterSpan": { const spanId = event.event.enterSpan.spanId; const span = currentSpans.find((s) => s.id === spanId); - const enteredAt = event.event.enterSpan.at ? convertTimestampToNanoseconds( - event.event.enterSpan.at - ) : -1; + const enteredAt = event.event.enterSpan.at + ? convertTimestampToNanoseconds(event.event.enterSpan.at) + : -1; if (span) { span.enters.push(enteredAt); } @@ -37,9 +39,9 @@ export function updatedSpans(currentSpans: Span[], spanEvents: SpanEvent[]) { case "exitSpan": { const spanId = event.event.exitSpan.spanId; const span = currentSpans.find((s) => s.id === spanId); - const exitedAt = event.event.exitSpan.at ? convertTimestampToNanoseconds( - event.event.exitSpan.at - ) : -1; + const exitedAt = event.event.exitSpan.at + ? convertTimestampToNanoseconds(event.event.exitSpan.at) + : -1; if (span) { span.exits.push(exitedAt); } @@ -50,9 +52,9 @@ export function updatedSpans(currentSpans: Span[], spanEvents: SpanEvent[]) { const spanId = event.event.closeSpan.spanId; const span = currentSpans.find((s) => s.id === spanId); if (span) { - span.closedAt = event.event.closeSpan.at ? convertTimestampToNanoseconds( - event.event.closeSpan.at - ) : -1; + span.closedAt = event.event.closeSpan.at + ? convertTimestampToNanoseconds(event.event.closeSpan.at) + : -1; span.duration = span.closedAt - span.createdAt; } break; diff --git a/web-client/tailwind.config.ts b/web-client/tailwind.config.ts index 66aec060..5a7bbc68 100644 --- a/web-client/tailwind.config.ts +++ b/web-client/tailwind.config.ts @@ -18,7 +18,7 @@ export default { sans: ["Euclid Circular B", "Inter", ...defaultTheme.fontFamily.sans], }, colors: { - 'nearly-invisible': '#ffffff09', + "nearly-invisible": "#ffffff09", navy: { 50: "#DCE2F4", 100: "#B9C6E9",