Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
TejasQ committed Nov 21, 2023
1 parent 5787e70 commit f538710
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 42 deletions.
58 changes: 29 additions & 29 deletions web-client/src/lib/span/ipc-spans.ts
Original file line number Diff line number Diff line change
@@ -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<IpcSpanName, string> = {
"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",
};
"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",
};
4 changes: 2 additions & 2 deletions web-client/src/lib/span/isIpcSpanName.ts
Original file line number Diff line number Diff line change
@@ -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);
}
return ipcSpans.includes(name as unknown as IpcSpanName);
};
22 changes: 12 additions & 10 deletions web-client/src/lib/span/update-spans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion web-client/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f538710

Please sign in to comment.