Skip to content

Commit

Permalink
Addressed code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kapil-tuptewar committed Sep 11, 2023
1 parent d64b9d7 commit bee5401
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/pubmaticAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,10 @@ function bidResponseHandler(args) {
bid.source = formatSource(bid.source || args.source);
setBidStatus(bid, args);
const latency = args?.timeToRespond || Date.now() - cache.auctions[args.auctionId].timestamp;
// Checking if latency is greater than auctiontime+100, if yes instead of logging actual latency log
// auctiontime+100 to keep actual values and to keep avarage latency in expected range.
bid.partnerTimeToRespond = window.PWT?.versionDetails?.timeout ? (latency > (window.PWT.versionDetails.timeout + 100) ? (window.PWT.versionDetails.timeout + 100) : latency) : latency;
const auctionTime = cache.auctions[args.auctionId].timeout;
// Checking if latency is greater than auctiontime+150, if yes instead of logging actual latency log
// auctiontime+150 to keep actual values and to keep avarage latency in expected range.
bid.partnerTimeToRespond = latency > (auctionTime + 150) ? (auctionTime + 150) : latency;
bid.clientLatencyTimeMs = Date.now() - cache.auctions[args.auctionId].timestamp;
bid.bidResponse = parseBidResponse(args);
}
Expand Down

0 comments on commit bee5401

Please sign in to comment.