@freqhole/api-client 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freqhole/api-client",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -94,12 +94,19 @@ export class CharnelLocalTransport implements Transport {
94
94
  }
95
95
  }
96
96
 
97
+ // temporary boot-timing instrumentation (see slow-tauri-boot investigation) —
98
+ // logs elapsed ms per IPC round-trip so a slow "loading..." screen can be
99
+ // narrowed down to a specific api call instead of guessing.
100
+ const requestStart = performance.now();
97
101
  try {
98
102
  // call dispatch via IPC
99
103
  const response = (await inv("api_call", {
100
104
  path,
101
105
  body: jsonBody,
102
106
  })) as ApiResponse;
107
+ console.info(
108
+ `[perf] api_call ${path} took ${(performance.now() - requestStart).toFixed(1)}ms`,
109
+ );
103
110
 
104
111
  // check for route_not_found - this is now a real error
105
112
  const errorType = response.errors?.[0]?.error_type;
@@ -127,6 +134,9 @@ export class CharnelLocalTransport implements Transport {
127
134
  };
128
135
  }
129
136
  } catch (err) {
137
+ console.info(
138
+ `[perf] api_call ${path} failed after ${(performance.now() - requestStart).toFixed(1)}ms`,
139
+ );
130
140
  // IPC error - treat as network error
131
141
  return {
132
142
  status: 0,