-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
43 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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"; | ||
|
||
export const ipcSpans: IpcSpanName[] = [ | ||
"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", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { IpcSpanName, ipcSpans } from "./ipc-spans"; | ||
|
||
export const isIpcSpanName = (name: string): name is IpcSpanName => { | ||
return ipcSpans.includes(name as unknown as IpcSpanName); | ||
} |