⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243510 in webkit


Ignore:
Timestamp:
Mar 26, 2019, 12:04:37 PM (7 years ago)
Author:
Dewei Zhu
Message:

Primary cluster of measurement set should always contain latest point.
https://bugs.webkit.org/show_bug.cgi?id=196243

Reviewed by Ryosuke Niwa.

Fix a bug in measurement-set api that primary cluster may not contain latest data point as
'carry_over' row may not be updated.

  • public/api/measurement-set.php: Should always keep 'carry_over' data points up to date.
  • server-tests/api-measurement-set-tests.js: Added an unit test for this change.

Fixed a typo.

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

Legend:

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

    r243358 r243510  
     12019-03-25  Dewei Zhu  <dewei_zhu@apple.com>
     2
     3        Primary cluster of measurement set should always contain latest point.
     4        https://bugs.webkit.org/show_bug.cgi?id=196243
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Fix a bug in measurement-set api that primary cluster may not contain latest data point as
     9        'carry_over' row may not be updated.
     10
     11        * public/api/measurement-set.php: Should always keep 'carry_over' data points up to date.
     12        * server-tests/api-measurement-set-tests.js: Added an unit test for this change.
     13        Fixed a typo.
     14
    1152019-03-21  Dewei Zhu  <dewei_zhu@apple.com>
    216
  • trunk/Websites/perf.webkit.org/public/api/measurement-set.php

    r236454 r243510  
    154154            if ($reached_end)
    155155                $this->queries[$name] = NULL;
    156             else {
    157                 $this->next_cluster_results[$name] = array_slice($results_by_config[$name], -2);
    158             }
     156            $this->next_cluster_results[$name] = array_slice($results_by_config[$name], -2);
    159157        }
    160158
  • trunk/Websites/perf.webkit.org/server-tests/api-measurement-set-tests.js

    r238164 r243510  
    108108        }}];
    109109
    110     const reportWithAncentRevision = [{
     110    const reportWithAncientRevision = [{
    111111        "buildNumber": "126",
    112112        "buildTime": "2013-02-28T23:07:25Z",
     
    125125                    "test1": {
    126126                        "metrics": {"Time": { "current": [21, 22, 23, 24, 25] }}
     127                    }
     128                }
     129            },
     130        }}];
     131
     132    const secondReportWithRevision = [{
     133        "buildNumber": "127",
     134        "buildTime": "2013-02-28T23:07:25Z",
     135        "revisions": {
     136            "WebKit": {
     137                "revision": "137794",
     138                "timestamp": clusterTime(11.1).toISOString()
     139            },
     140        },
     141        "builderName": "someBuilder",
     142        "builderPassword": "somePassword",
     143        "platform": "Mountain Lion",
     144        "tests": {
     145            "Suite": {
     146                "tests": {
     147                    "test1": {
     148                        "metrics": {"Time": { "current": [21, 22, 23, 24, 25] }}
     149                    }
     150                }
     151            },
     152        }}];
     153
     154    const thirdReportWithRevision = [{
     155        "buildNumber": "128",
     156        "buildTime": "2013-02-28T23:07:25Z",
     157        "revisions": {
     158            "WebKit": {
     159                "revision": "137795",
     160                "timestamp": clusterTime(11.2).toISOString()
     161            },
     162        },
     163        "builderName": "someBuilder",
     164        "builderPassword": "somePassword",
     165        "platform": "Mountain Lion",
     166        "tests": {
     167            "Suite": {
     168                "tests": {
     169                    "test1": {
     170                        "metrics": {"Time": { "current": [21, 22, 23, 24, 25] }}
     171                    }
     172                }
     173            },
     174        }}];
     175
     176    const reportBaselineWithRevision = [{
     177        "buildNumber": "129",
     178        "buildTime": "2013-02-28T15:35:51Z",
     179        "revisions": {
     180            "WebKit": {
     181                "revision": "144001",
     182                "timestamp": clusterTime(13.35645364537).toISOString(),
     183            },
     184        },
     185        "builderName": "someBuilder",
     186        "builderPassword": "somePassword",
     187        "platform": "Mountain Lion",
     188        "tests": {
     189            "Suite": {
     190                "tests": {
     191                    "test1": {
     192                        "metrics": {"Time": { "baseline": [11, 12, 13, 14, 15] }}
     193                    }
     194                }
     195            },
     196        }}];
     197
     198    const secondReportBaselineWithRevision = [{
     199        "buildNumber": "130",
     200        "buildTime": "2013-02-28T23:01:25Z",
     201        "revisions": {
     202            "WebKit": {
     203                "revision": "137784",
     204                "timestamp": clusterTime(11.12).toISOString()
     205            },
     206        },
     207        "builderName": "someBuilder",
     208        "builderPassword": "somePassword",
     209        "platform": "Mountain Lion",
     210        "tests": {
     211            "Suite": {
     212                "tests": {
     213                    "test1": {
     214                        "metrics": {"Time": { "baseline": [21, 22, 23, 24, 25] }}
     215                    }
     216                }
     217            },
     218        }}];
     219
     220    const thirdReportBaselineWithRevision = [{
     221        "buildNumber": "131",
     222        "buildTime": "2013-02-28T23:01:25Z",
     223        "revisions": {
     224            "WebKit": {
     225                "revision": "137884",
     226                "timestamp": clusterTime(11.22).toISOString()
     227            },
     228        },
     229        "builderName": "someBuilder",
     230        "builderPassword": "somePassword",
     231        "platform": "Mountain Lion",
     232        "tests": {
     233            "Suite": {
     234                "tests": {
     235                    "test1": {
     236                        "metrics": {"Time": { "baseline": [21, 22, 23, 24, 25] }}
    127237                    }
    128238                }
     
    343453    });
    344454
     455    it("should keep 'carry_over' points up to date", async () => {
     456        const remote = TestServer.remoteAPI();
     457        await addBuilderForReport(reportWithRevision[0]);
     458        await remote.postJSON('/api/report/', reportWithRevision);
     459        await remote.postJSON('/api/report/', secondReportWithRevision);
     460        await remote.postJSON('/api/report/', thirdReportWithRevision);
     461        await remote.postJSON('/api/report/', reportBaselineWithRevision);
     462        await remote.postJSON('/api/report/', secondReportBaselineWithRevision);
     463        await remote.postJSON('/api/report/', thirdReportBaselineWithRevision);
     464        const result = await queryPlatformAndMetricWithRepository('Mountain Lion', 'Time', 'WebKit');
     465
     466        const response = await remote.getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`);
     467
     468        const currentRows = response['configurations']['current'];
     469        assert.equal(currentRows.length, 2);
     470        assert.deepEqual(format(response['formatMap'], currentRows[0]).buildNumber, 127);
     471        assert.deepEqual(format(response['formatMap'], currentRows[1]).buildNumber, 128);
     472        assert(format(response['formatMap'], currentRows[0]).commitTime < response.startTime);
     473        assert(format(response['formatMap'], currentRows[1]).commitTime < response.startTime);
     474
     475        const baselineRows = response['configurations']['baseline'];
     476        assert.equal(baselineRows.length, 2);
     477        assert.deepEqual(format(response['formatMap'], baselineRows[0]).buildNumber, 131);
     478        assert.deepEqual(format(response['formatMap'], baselineRows[1]).buildNumber, 129);
     479    });
     480
    345481    it("should order results by build time when commit times are missing", () => {
    346482        const remote = TestServer.remoteAPI();
     
    419555        const remote = TestServer.remoteAPI();
    420556        return addBuilderForReport(reportWithBuildTime[0]).then(() => {
    421             return remote.postJSON('/api/report/', reportWithAncentRevision);
     557            return remote.postJSON('/api/report/', reportWithAncientRevision);
    422558        }).then(() => {
    423559            return remote.postJSON('/api/report/', reportWithNewRevision);
     
    430566            assert.equal(response['clusterCount'], 2, 'should have two clusters');
    431567            assert.deepEqual(buildNumbers(response, 'current'),
    432                 [reportWithAncentRevision[0]['buildNumber'], reportWithNewRevision[0]['buildNumber']]);
     568                [reportWithAncientRevision[0]['buildNumber'], reportWithNewRevision[0]['buildNumber']]);
    433569        });
    434570    });
     
    439575            return remote.postJSON('/api/report/', reportWithBuildTime);
    440576        }).then(() => {
    441             return remote.postJSON('/api/report/', reportWithAncentRevision);
     577            return remote.postJSON('/api/report/', reportWithAncientRevision);
    442578        }).then(() => {
    443579            return queryPlatformAndMetric('Mountain Lion', 'Time');
     
    448584            let currentRows = response['configurations']['current'];
    449585            assert.equal(currentRows.length, 2, 'should contain two data points');
    450             assert.deepEqual(buildNumbers(response, 'current'), [reportWithAncentRevision[0]['buildNumber'], reportWithBuildTime[0]['buildNumber']]);
     586            assert.deepEqual(buildNumbers(response, 'current'), [reportWithAncientRevision[0]['buildNumber'], reportWithBuildTime[0]['buildNumber']]);
    451587        });
    452588    });
     
    456592        let cachePrefix;
    457593        return addBuilderForReport(reportWithBuildTime[0]).then(() => {
    458             return remote.postJSON('/api/report/', reportWithAncentRevision);
     594            return remote.postJSON('/api/report/', reportWithAncientRevision);
    459595        }).then(() => {
    460596            return remote.postJSON('/api/report/', reportWithRevision);
Note: See TracChangeset for help on using the changeset viewer.