Skip to content

Commit

Permalink
Clean: code review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishna Kapadia committed Feb 9, 2021
1 parent b8d6df9 commit 7bcd92a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
* v2.22.0
- Adds the ability to track Core Web Vitals when the `trackCoreWebVitals` option is enabled. This also ensures that First Input Delay is reported from non-chromium sessions.
- Adds the ability to track Core Web Vitals when the `trackCoreWebVitals` option is enabled.

* v2.21.1
- Fixes an issue where errors generated on Cordova iOS 6.0+ applications would not contain a stack trace due to the scheme changing from `file` and to `app`
Expand Down
53 changes: 49 additions & 4 deletions rum-spa-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,57 @@ <h2>das da stuff</h2>
trackCoreWebVitals: true
});

setTimeout(function () {
var button = document.getElementById("btn");
button.click();
}, 1000);
rg4js('trackEvent', {
type: 'customTiming',
name: 'customTiming',
duration: 1200,
});

window.performance.mark('pageNavigation');

setTimeout(() => {
window.performance.measure('testPageNavigation', 'pageNavigation');

rg4js('trackEvent', {
type: 'pageView',
path: '/menu'
});

setTimeout(() => {
rg4js('trackEvent', {
type: 'pageView',
path: '/order'
});

setTimeout(() => {
rg4js('trackEvent', {
type: 'pageView',
path: '/login'
});

rg4js('setUser', {
identifier: emails[Math.floor(Math.random() * (emails.length - 1))]
});

setTimeout(() => {
rg4js('trackEvent', {
type: 'pageView',
path: '/order'
});
}, 50);

setTimeout(() => {
rg4js('trackEvent', {
type: 'pageView',
path: '/success'
});
}, 250);
}, 250);
}, 250);
}, 250);

</script>
<button id="btn"></button>

</body>
</html>
2 changes: 1 addition & 1 deletion src/raygun.rum/core-web-vitals.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require('./core-web-vitals');

describe("core-web-vitals", () => {
let CoreWebVitals = window.raygunCoreWebVitalFactory({ webVitals: null }), queue = [];
const CoreWebVitals = window.raygunCoreWebVitalFactory({ webVitals: null }), queue = [];
CoreWebVitals.attach(e => queue.push(e));

describe("handler is called", () => {
Expand Down

0 comments on commit 7bcd92a

Please sign in to comment.