@3dsource/angular-unreal-module 0.0.138 → 0.0.139

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.
@@ -5107,6 +5107,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
5107
5107
  type: Injectable
5108
5108
  }], ctorParameters: () => [] });
5109
5109
 
5110
+ /** Trim a resource URL to its path: drop origin and query string so the
5111
+ * emitted name is short, stable, and not a PII-bearing query. */
5112
+ function shortResourceName(url) {
5113
+ try {
5114
+ return new URL(url).pathname;
5115
+ }
5116
+ catch {
5117
+ return (url || '').split('?')[0];
5118
+ }
5119
+ }
5110
5120
  const QP_RED_THRESHOLD = 35;
5111
5121
  const FPS_LOW_RATIO = 0.7; // p50 fps below 70% of target
5112
5122
  const UNLIMITED_REFERENCE_FPS = 60;
@@ -5797,6 +5807,9 @@ class StreamStatusTelemetryService2 {
5797
5807
  // attributes them to `HTML loading` and `Route idle` respectively.
5798
5808
  resources: split.resources,
5799
5809
  lazyResources: split.lazyResources,
5810
+ // Top-8 slowest individual resources (path + duration), so the viewer
5811
+ // can name the offending file / GraphQL endpoint.
5812
+ slowestResources: split.slowestResources,
5800
5813
  };
5801
5814
  }
5802
5815
  catch {
@@ -5825,19 +5838,22 @@ class StreamStatusTelemetryService2 {
5825
5838
  try {
5826
5839
  const list = performance.getEntriesByType('resource');
5827
5840
  if (!list.length)
5828
- return { resources: null, lazyResources: null };
5841
+ return { resources: null, lazyResources: null, slowestResources: [] };
5829
5842
  const empty = () => ({
5830
5843
  count: 0,
5831
5844
  cachedCount: 0,
5832
5845
  transferSize: 0,
5833
5846
  encodedBodySize: 0,
5834
5847
  decodedBodySize: 0,
5848
+ durationMs: 0,
5849
+ maxDurationMs: 0,
5835
5850
  });
5836
5851
  const splitEnabled = loadEventEnd > 0;
5837
5852
  const pageLoadTotals = empty();
5838
5853
  const pageLoadByType = {};
5839
5854
  const lazyTotals = empty();
5840
5855
  const lazyByType = {};
5856
+ const slow = []; // every timed resource; trimmed to top-N
5841
5857
  for (const r of list) {
5842
5858
  const type = r.initiatorType || 'other';
5843
5859
  const isLazy = splitEnabled && r.startTime > loadEventEnd;
@@ -5848,28 +5864,50 @@ class StreamStatusTelemetryService2 {
5848
5864
  const t = r.transferSize || 0;
5849
5865
  const enc = r.encodedBodySize || 0;
5850
5866
  const dec = r.decodedBodySize || 0;
5867
+ const dur = r.duration || 0; // responseEnd − startTime (ms)
5851
5868
  b.count++;
5852
5869
  if (fromCache)
5853
5870
  b.cachedCount++;
5854
5871
  b.transferSize += t;
5855
5872
  b.encodedBodySize += enc;
5856
5873
  b.decodedBodySize += dec;
5874
+ b.durationMs += dur;
5875
+ if (dur > b.maxDurationMs)
5876
+ b.maxDurationMs = dur;
5857
5877
  totals.count++;
5858
5878
  if (fromCache)
5859
5879
  totals.cachedCount++;
5860
5880
  totals.transferSize += t;
5861
5881
  totals.encodedBodySize += enc;
5862
5882
  totals.decodedBodySize += dec;
5883
+ totals.durationMs += dur;
5884
+ if (dur > totals.maxDurationMs)
5885
+ totals.maxDurationMs = dur;
5886
+ if (dur > 0) {
5887
+ slow.push({
5888
+ name: shortResourceName(r.name),
5889
+ type,
5890
+ durationMs: Math.round(dur),
5891
+ transferKb: Math.round((t / 1024) * 10) / 10,
5892
+ lazy: isLazy,
5893
+ });
5894
+ }
5863
5895
  }
5896
+ slow.sort((a, b) => b.durationMs - a.durationMs);
5864
5897
  return {
5865
5898
  resources: pageLoadTotals.count > 0
5866
5899
  ? { ...pageLoadTotals, byType: pageLoadByType }
5867
5900
  : null,
5868
5901
  lazyResources: lazyTotals.count > 0 ? { ...lazyTotals, byType: lazyByType } : null,
5902
+ // Top-8 slowest individual resources (path only, query stripped) so
5903
+ // the viewer can name the offending file / endpoint. GraphQL appears
5904
+ // here as its endpoint path (one entry per call) — Resource Timing
5905
+ // can't expose the operation name (it's in the POST body).
5906
+ slowestResources: slow.slice(0, 8),
5869
5907
  };
5870
5908
  }
5871
5909
  catch {
5872
- return { resources: null, lazyResources: null };
5910
+ return { resources: null, lazyResources: null, slowestResources: [] };
5873
5911
  }
5874
5912
  }
5875
5913
  aggregate(values) {