Bug 195912

Summary: Fix a bug from r226303 that latest build time is not correctly calculated.
Product: WebKit Reporter: dewei_zhu
Component: New BugsAssignee: dewei_zhu
Status: NEW ---    
Severity: Normal CC: dewei_zhu, rniwa
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch rniwa: review+

Description dewei_zhu 2019-03-18 14:13:12 PDT
Fix a bug from r226303 that latest build time is not correctly calculated.
Comment 1 dewei_zhu 2019-03-18 14:15:41 PDT
Created attachment 365063 [details]
Patch
Comment 2 Ryosuke Niwa 2019-03-18 14:44:01 PDT
Comment on attachment 365063 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=365063&action=review

> Websites/perf.webkit.org/public/v3/models/time-series.js:21
> +        if (!this._latestBuildPoint || (this._latestBuildPoint.build() &&  this._latestBuildPoint.build().buildTime() < item.build().buildTime()))
> +            this._latestBuildPoint = item;

This is a layering violation. TimeSeries class shouldn't be aware of build() and its values, etc...

> Websites/perf.webkit.org/public/v3/pages/test-freshness-page.js:94
> +                    const latestBuildPoint = currentTimeSeries.latestBuildPoint();

Just find the point based on build time here.
This happens once for each callback from measurementSet.fetchBetween anyway so the perf isn't an issue.
Doing a bunch of checks in TimeSeries.append would be way slower.
Comment 3 dewei_zhu 2019-03-18 15:06:06 PDT
Created attachment 365072 [details]
Patch