Skip to content

Commit

Permalink
add timings
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrmartinez committed May 31, 2021
1 parent 5fcfd79 commit 55b88cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions modules/rubiconAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const COOKIE_NAME = 'rpaSession';
const LAST_SEEN_EXPIRE_TIME = 1800000; // 30 mins
const END_EXPIRE_TIME = 21600000; // 6 hours

const MODULE_INITIALIZED_TIME = utils.getPerformanceNow();

const pbsErrorMap = {
1: 'timeout-error',
2: 'input-error',
Expand Down Expand Up @@ -302,10 +304,12 @@ function sendMessage(auctionId, bidWonId, trigger) {
message.bidsWon = bidsWon;
}

message.eventTiming = Math.round(utils.getPerformanceNow() - auctionCache.endTs);
message.timeAfterLoad = Math.round(utils.getPerformanceNow() - MODULE_INITIALIZED_TIME);
message.timeAfterAuctionEnd = Math.round(utils.getPerformanceNow() - auctionCache.endTs);
auctionCache.sent = true;
} else if (bidWonId && auctionCache && auctionCache.bids[bidWonId]) {
message.eventTiming = Math.round(utils.getPerformanceNow() - auctionCache.endTs);
message.timeAfterLoad = Math.round(utils.getPerformanceNow() - MODULE_INITIALIZED_TIME);
message.timeAfterAuctionEnd = Math.round(utils.getPerformanceNow() - auctionCache.endTs);
message.bidsWon = [
formatBidWon(auctionCache.bids[bidWonId])
];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prebid.js",
"version": "4.33.0",
"version": "4.33.2",
"description": "Header Bidding Management Library",
"main": "src/prebid.js",
"scripts": {
Expand Down

0 comments on commit 55b88cc

Please sign in to comment.