@openfin/node-adapter 46.100.67 → 46.100.71
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/out/node-adapter.js +42 -1
- package/package.json +2 -2
package/out/node-adapter.js
CHANGED
|
@@ -2350,6 +2350,47 @@ class Application extends EmitterBase {
|
|
|
2350
2350
|
constructor(wire, identity) {
|
|
2351
2351
|
super(wire, 'application', identity.uuid);
|
|
2352
2352
|
this.identity = identity;
|
|
2353
|
+
/**
|
|
2354
|
+
* @experimental
|
|
2355
|
+
* Retrieves a performance snapshot for all Windows, Views and Frames in the Application.
|
|
2356
|
+
*
|
|
2357
|
+
* By default, all custom marks and measures are collected, along with navigation/paint entries
|
|
2358
|
+
* and resource timing (`resources` defaults to `true`). Pass `include` to restrict custom
|
|
2359
|
+
* marks/measures to matching names (string substring or RegExp). Pass `browser: true` to also
|
|
2360
|
+
* include hereio internal runtime metrics.
|
|
2361
|
+
*
|
|
2362
|
+
* See also [MDN | Performance Mark API](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark)
|
|
2363
|
+
*
|
|
2364
|
+
* Note - only currently running WebContents will be captured, and performance entries can only be
|
|
2365
|
+
* captured for the current navigation of each.
|
|
2366
|
+
*/
|
|
2367
|
+
this.getPerformanceStats = async (options = {}) => {
|
|
2368
|
+
/**
|
|
2369
|
+
* Returns a filter object compatible with JSON.stringify (regexs stringify to `{}`).
|
|
2370
|
+
* @param include Array of strings or regexps.
|
|
2371
|
+
*/
|
|
2372
|
+
const getSerializableFilterObject = (include) => {
|
|
2373
|
+
return include.map((filter) => {
|
|
2374
|
+
if (filter instanceof RegExp) {
|
|
2375
|
+
return {
|
|
2376
|
+
type: 'regex',
|
|
2377
|
+
expression: filter.source,
|
|
2378
|
+
flags: filter.flags
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
return filter;
|
|
2382
|
+
});
|
|
2383
|
+
};
|
|
2384
|
+
const { include, resources = true, browser = false } = options;
|
|
2385
|
+
const result = await this.wire.sendAction('get-application-performance-stats', {
|
|
2386
|
+
...this.identity,
|
|
2387
|
+
// Omit `include` when unspecified so the runtime collects all custom marks/measures.
|
|
2388
|
+
...(include !== undefined ? { include: getSerializableFilterObject(include) } : {}),
|
|
2389
|
+
resources,
|
|
2390
|
+
browser
|
|
2391
|
+
});
|
|
2392
|
+
return result.payload.data;
|
|
2393
|
+
};
|
|
2353
2394
|
this.window = new _Window(this.wire, {
|
|
2354
2395
|
uuid: this.identity.uuid,
|
|
2355
2396
|
name: this.identity.uuid
|
|
@@ -17550,7 +17591,7 @@ class NodeEnvironment extends BaseEnvironment {
|
|
|
17550
17591
|
};
|
|
17551
17592
|
}
|
|
17552
17593
|
getAdapterVersionSync() {
|
|
17553
|
-
return "46.100.
|
|
17594
|
+
return "46.100.71";
|
|
17554
17595
|
}
|
|
17555
17596
|
observeBounds(element, onChange) {
|
|
17556
17597
|
throw new Error('Method not implemented.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/node-adapter",
|
|
3
|
-
"version": "46.100.
|
|
3
|
+
"version": "46.100.71",
|
|
4
4
|
"description": "See README.md",
|
|
5
5
|
"main": "out/node-adapter.js",
|
|
6
6
|
"types": "out/node-adapter.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"es-toolkit": "^1.39.3",
|
|
21
21
|
"ws": "^7.5.11",
|
|
22
22
|
"tslib": "2.8.1",
|
|
23
|
-
"@openfin/core": "46.100.
|
|
23
|
+
"@openfin/core": "46.100.71"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"prebuild": "rimraf ./out",
|