@openfin/remote-adapter 46.100.68 → 46.100.72
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/remote-adapter.js +41 -0
- package/package.json +2 -2
package/out/remote-adapter.js
CHANGED
|
@@ -3766,6 +3766,47 @@ class Application extends EmitterBase {
|
|
|
3766
3766
|
constructor(wire, identity) {
|
|
3767
3767
|
super(wire, 'application', identity.uuid);
|
|
3768
3768
|
this.identity = identity;
|
|
3769
|
+
/**
|
|
3770
|
+
* @experimental
|
|
3771
|
+
* Retrieves a performance snapshot for all Windows, Views and Frames in the Application.
|
|
3772
|
+
*
|
|
3773
|
+
* By default, all custom marks and measures are collected, along with navigation/paint entries
|
|
3774
|
+
* and resource timing (`resources` defaults to `true`). Pass `include` to restrict custom
|
|
3775
|
+
* marks/measures to matching names (string substring or RegExp). Pass `browser: true` to also
|
|
3776
|
+
* include hereio internal runtime metrics.
|
|
3777
|
+
*
|
|
3778
|
+
* See also [MDN | Performance Mark API](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark)
|
|
3779
|
+
*
|
|
3780
|
+
* Note - only currently running WebContents will be captured, and performance entries can only be
|
|
3781
|
+
* captured for the current navigation of each.
|
|
3782
|
+
*/
|
|
3783
|
+
this.getPerformanceStats = async (options = {}) => {
|
|
3784
|
+
/**
|
|
3785
|
+
* Returns a filter object compatible with JSON.stringify (regexs stringify to `{}`).
|
|
3786
|
+
* @param include Array of strings or regexps.
|
|
3787
|
+
*/
|
|
3788
|
+
const getSerializableFilterObject = (include) => {
|
|
3789
|
+
return include.map((filter) => {
|
|
3790
|
+
if (filter instanceof RegExp) {
|
|
3791
|
+
return {
|
|
3792
|
+
type: 'regex',
|
|
3793
|
+
expression: filter.source,
|
|
3794
|
+
flags: filter.flags
|
|
3795
|
+
};
|
|
3796
|
+
}
|
|
3797
|
+
return filter;
|
|
3798
|
+
});
|
|
3799
|
+
};
|
|
3800
|
+
const { include, resources = true, browser = false } = options;
|
|
3801
|
+
const result = await this.wire.sendAction('get-application-performance-stats', {
|
|
3802
|
+
...this.identity,
|
|
3803
|
+
// Omit `include` when unspecified so the runtime collects all custom marks/measures.
|
|
3804
|
+
...(include !== undefined ? { include: getSerializableFilterObject(include) } : {}),
|
|
3805
|
+
resources,
|
|
3806
|
+
browser
|
|
3807
|
+
});
|
|
3808
|
+
return result.payload.data;
|
|
3809
|
+
};
|
|
3769
3810
|
this.window = new _Window(this.wire, {
|
|
3770
3811
|
uuid: this.identity.uuid,
|
|
3771
3812
|
name: this.identity.uuid
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/remote-adapter",
|
|
3
|
-
"version": "46.100.
|
|
3
|
+
"version": "46.100.72",
|
|
4
4
|
"description": "Establish intermachine runtime connections using webRTC.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"private": false,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"es-toolkit": "^1.39.3",
|
|
18
18
|
"tslib": "2.8.1",
|
|
19
|
-
"@openfin/core": "46.100.
|
|
19
|
+
"@openfin/core": "46.100.72"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"prebuild": "rimraf ./out",
|