Changeset 194207 in webkit


Ignore:
Timestamp:
Dec 16, 2015 8:26:32 PM (8 years ago)
Author:
rniwa@webkit.org
Message:

Perf Dashboard v3 UI doesn't show recent data points on v2 UI
https://bugs.webkit.org/show_bug.cgi?id=152368

Reviewed by Chris Dumez.

The bug was caused by the last modified date in measurement set JSON being a string instead of a POSIX timestamp,
which prevented the v3 UI from invalidating the cache. Specifically, the following boolean logic always evaluated
to false because +datalastModified? was NaN in MeasurementSet.prototype._fetch (/v3/models/measurement-set.js):

!clusterEndTime && useCache && +datalastModified? < self._lastModified

Fixed the bug by calling Database::to_js_time on the last modified date fetched from the database.

  • public/api/measurement-set.php:

(MeasurementSetFetcher::fetch_config_list): Convert the string returned by the database to a POSIX timestamp.

  • tests/api-measurement-set.js: Added a test to ensure the last modified date in JSON is numeric. Since the value

of the last modified date depends on when tests run, we can't assert it to be a certain value.

Location:
trunk/Websites/perf.webkit.org
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/perf.webkit.org/ChangeLog

    r194188 r194207  
     12015-12-16  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Perf Dashboard v3 UI doesn't show recent data points on v2 UI
     4        https://bugs.webkit.org/show_bug.cgi?id=152368
     5
     6        Reviewed by Chris Dumez.
     7
     8        The bug was caused by the last modified date in measurement set JSON being a string instead of a POSIX timestamp,
     9        which prevented the v3 UI from invalidating the cache. Specifically, the following boolean logic always evaluated
     10        to false because +data['lastModified'] was NaN in MeasurementSet.prototype._fetch (/v3/models/measurement-set.js):
     11
     12        !clusterEndTime && useCache && +data['lastModified'] < self._lastModified
     13
     14        Fixed the bug by calling Database::to_js_time on the last modified date fetched from the database.
     15
     16        * public/api/measurement-set.php:
     17        (MeasurementSetFetcher::fetch_config_list): Convert the string returned by the database to a POSIX timestamp.
     18        * tests/api-measurement-set.js: Added a test to ensure the last modified date in JSON is numeric. Since the value
     19        of the last modified date depends on when tests run, we can't assert it to be a certain value.
     20
    1212015-12-16  Ryosuke Niwa  <rniwa@webkit.org>
    222
  • trunk/Websites/perf.webkit.org/public/api/measurement-set.php

    r194120 r194207  
    8686            $query = $this->execute_query($config_row['config_id']);
    8787
    88             $this->last_modified = max($this->last_modified, $config_row['config_runs_last_modified']);
     88            $this->last_modified = max($this->last_modified, Database::to_js_time($config_row['config_runs_last_modified']));
    8989
    9090            $measurement_row = $this->db->fetch_next_row($query);
  • trunk/Websites/perf.webkit.org/tests/api-measurement-set.js

    r194120 r194207  
    207207
    208208                        assert.equal(paresdResult['startTime'], reportWithBuildTime.startTime);
     209                        assert(typeof(paresdResult['lastModified']) == 'number', 'lastModified time should be a numeric');
    209210
    210211                        assert.deepEqual(Object.keys(paresdResult['configurations']), ['current']);
Note: See TracChangeset for help on using the changeset viewer.