Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boomerang device trace divider #511

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions plugin/boomerang/countly_boomerang.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

/* global Countly */

Check warning on line 3 in plugin/boomerang/countly_boomerang.js

View workflow job for this annotation

GitHub Actions / build-and-test (12.x)

'Countly' is defined but never used

Check warning on line 3 in plugin/boomerang/countly_boomerang.js

View workflow job for this annotation

GitHub Actions / build-and-test (14.x)

'Countly' is defined but never used

Check warning on line 3 in plugin/boomerang/countly_boomerang.js

View workflow job for this annotation

GitHub Actions / build-and-test (16.x)

'Countly' is defined but never used
/*
Countly APM based on Boomerang JS
Plugin being used - RT, AutoXHR, Continuity, NavigationTiming, ResourceTiming
Expand Down Expand Up @@ -81,6 +81,18 @@
if (typeof beaconData["c.fid"] !== "undefined") {
trace.apm_metrics.first_input_delay = beaconData["c.fid"];
}
for (var key in trace.apm_metrics) {
var newTrace = {};
newTrace.type = trace.type;
newTrace.name = key;
newTrace.apm_metrics = {};
newTrace.apm_metrics.duration = trace.apm_metrics[key];
newTrace.apm_metrics.url = (beaconData.u + "").split("//").pop().split("?")[0];
newTrace.apm_metrics.ts = Date.now();
newTrace.stz = beaconData["rt.tstart"];
newTrace.etz = beaconData["rt.end"];
self.report_trace(newTrace);
}
}
else if (beaconData["http.initiator"] && ["xhr", "spa", "spa_hard"].indexOf(beaconData["http.initiator"]) !== -1) {
var responseTime; var responsePayloadSize; var requestPayloadSize; var
Expand Down Expand Up @@ -124,9 +136,6 @@
request_payload_size: requestPayloadSize,
response_code: responseCode
};
}

if (trace.type) {
trace.name = (beaconData.u + "").split("//").pop().split("?")[0];
trace.stz = beaconData["rt.tstart"];
trace.etz = beaconData["rt.end"];
Expand Down
Loading