@openfin/core 46.100.66 → 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/stub.js CHANGED
@@ -2518,6 +2518,47 @@ class Application extends EmitterBase {
2518
2518
  constructor(wire, identity) {
2519
2519
  super(wire, 'application', identity.uuid);
2520
2520
  this.identity = identity;
2521
+ /**
2522
+ * @experimental
2523
+ * Retrieves a performance snapshot for all Windows, Views and Frames in the Application.
2524
+ *
2525
+ * By default, all custom marks and measures are collected, along with navigation/paint entries
2526
+ * and resource timing (`resources` defaults to `true`). Pass `include` to restrict custom
2527
+ * marks/measures to matching names (string substring or RegExp). Pass `browser: true` to also
2528
+ * include hereio internal runtime metrics.
2529
+ *
2530
+ * See also [MDN | Performance Mark API](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark)
2531
+ *
2532
+ * Note - only currently running WebContents will be captured, and performance entries can only be
2533
+ * captured for the current navigation of each.
2534
+ */
2535
+ this.getPerformanceStats = async (options = {}) => {
2536
+ /**
2537
+ * Returns a filter object compatible with JSON.stringify (regexs stringify to `{}`).
2538
+ * @param include Array of strings or regexps.
2539
+ */
2540
+ const getSerializableFilterObject = (include) => {
2541
+ return include.map((filter) => {
2542
+ if (filter instanceof RegExp) {
2543
+ return {
2544
+ type: 'regex',
2545
+ expression: filter.source,
2546
+ flags: filter.flags
2547
+ };
2548
+ }
2549
+ return filter;
2550
+ });
2551
+ };
2552
+ const { include, resources = true, browser = false } = options;
2553
+ const result = await this.wire.sendAction('get-application-performance-stats', {
2554
+ ...this.identity,
2555
+ // Omit `include` when unspecified so the runtime collects all custom marks/measures.
2556
+ ...(include !== undefined ? { include: getSerializableFilterObject(include) } : {}),
2557
+ resources,
2558
+ browser
2559
+ });
2560
+ return result.payload.data;
2561
+ };
2521
2562
  this.window = new _Window(this.wire, {
2522
2563
  uuid: this.identity.uuid,
2523
2564
  name: this.identity.uuid
package/out/stub.mjs CHANGED
@@ -2514,6 +2514,47 @@ class Application extends EmitterBase {
2514
2514
  constructor(wire, identity) {
2515
2515
  super(wire, 'application', identity.uuid);
2516
2516
  this.identity = identity;
2517
+ /**
2518
+ * @experimental
2519
+ * Retrieves a performance snapshot for all Windows, Views and Frames in the Application.
2520
+ *
2521
+ * By default, all custom marks and measures are collected, along with navigation/paint entries
2522
+ * and resource timing (`resources` defaults to `true`). Pass `include` to restrict custom
2523
+ * marks/measures to matching names (string substring or RegExp). Pass `browser: true` to also
2524
+ * include hereio internal runtime metrics.
2525
+ *
2526
+ * See also [MDN | Performance Mark API](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark)
2527
+ *
2528
+ * Note - only currently running WebContents will be captured, and performance entries can only be
2529
+ * captured for the current navigation of each.
2530
+ */
2531
+ this.getPerformanceStats = async (options = {}) => {
2532
+ /**
2533
+ * Returns a filter object compatible with JSON.stringify (regexs stringify to `{}`).
2534
+ * @param include Array of strings or regexps.
2535
+ */
2536
+ const getSerializableFilterObject = (include) => {
2537
+ return include.map((filter) => {
2538
+ if (filter instanceof RegExp) {
2539
+ return {
2540
+ type: 'regex',
2541
+ expression: filter.source,
2542
+ flags: filter.flags
2543
+ };
2544
+ }
2545
+ return filter;
2546
+ });
2547
+ };
2548
+ const { include, resources = true, browser = false } = options;
2549
+ const result = await this.wire.sendAction('get-application-performance-stats', {
2550
+ ...this.identity,
2551
+ // Omit `include` when unspecified so the runtime collects all custom marks/measures.
2552
+ ...(include !== undefined ? { include: getSerializableFilterObject(include) } : {}),
2553
+ resources,
2554
+ browser
2555
+ });
2556
+ return result.payload.data;
2557
+ };
2517
2558
  this.window = new _Window(this.wire, {
2518
2559
  uuid: this.identity.uuid,
2519
2560
  name: this.identity.uuid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "46.100.66",
3
+ "version": "46.100.71",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "out/stub.js",