Skip to content

Commit

Permalink
Clean up: no need to change 0 to 1 as data pipeline handles 0 now. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lannka committed May 30, 2017
1 parent 05b8472 commit 0dfd8ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/service/performance-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ export class Performance {
const data = {
label,
value,
// Delta can be 0 or negative, but will always be changed to 1.
delta: opt_delta != null ? Math.max(opt_delta, 1) : undefined,
// Delta can negative, but will always be changed to 0.
delta: opt_delta != null ? Math.max(opt_delta, 0) : undefined,
};
if (this.isMessagingReady_ && this.isPerformanceTrackingOn_) {
this.viewer_.sendMessage('tick', data);
Expand Down
4 changes: 2 additions & 2 deletions test/functional/test-performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describes.realWin('performance', {amp: true}, env => {
expect(perf.events_[c])
.to.be.jsonEqual({
label: 'test1',
delta: 1,
delta: 0,
});

c++;
Expand All @@ -82,7 +82,7 @@ describes.realWin('performance', {amp: true}, env => {
expect(perf.events_[c])
.to.be.jsonEqual({
label: 'test2',
delta: 1,
delta: 0,
});

c++;
Expand Down

0 comments on commit 0dfd8ef

Please sign in to comment.