Skip to content

Commit

Permalink
Merge pull request #130 from adobe/missingresource-1x
Browse files Browse the repository at this point in the history
missingresource 1x
  • Loading branch information
trieloff authored Mar 4, 2024
2 parents 5866158 + 204af90 commit 44db513
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,13 @@ const observer = new PerformanceObserver((list) => {
.forEach((entry) => {
sampleRUM('loadresource', { source: entry.name, target: Math.round(entry.duration) });
});
if (window.origin === 'business.adobe.com') {
// feature flagged for now
list.getEntries()
.filter((entry) => entry.responseStatus === 404)
.forEach((entry) => {
sampleRUM('missingresource', { source: entry.name, target: entry.hostname });
});
}
});
observer.observe({ type: 'resource', buffered: true });

0 comments on commit 44db513

Please sign in to comment.