commit time returned by '/api/measurement-set' should match the one returned by ...
authordewei_zhu@apple.com <dewei_zhu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2018 05:31:45 +0000 (05:31 +0000)
committerdewei_zhu@apple.com <dewei_zhu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2018 05:31:45 +0000 (05:31 +0000)
commit22c5784f93fb4a69ab029881376a3b3c96a51d8b
treef6aed70f37b236c12af87e2a0acb43080214d9b3
parentca55a2228777b40a0f262d03d31c76391ba399f8
commit time returned by '/api/measurement-set' should match the one returned by '/api/commits'.
https://bugs.webkit.org/show_bug.cgi?id=191457

Reviewed by Dean Jackson and Ryosuke Niwa.

Commit time returned by '/api/measurement-set' sometimes is calculated by 'epoch from ..'.
This function will return a floating number with 5 or 6 decimal digits due to double precision limitations.
However, some commits may be reported with 6 decimal decimal.
So the commit time for those commits will be rounded to 5 decimal digits.
In order to avoid front end assertion failure in CommitLog, Database::to_js_time need to
match this behavior.

* public/include/db.php: Change the behavior to match that of postgres.
Added logic to avoid losing precision in php.
* server-tests/api-measurement-set-tests.js: Added unit tests for this bug.
(queryPlatformAndMetric): Fix a bug that arguments are not used at all.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/include/db.php
Websites/perf.webkit.org/public/include/report-processor.php
Websites/perf.webkit.org/server-tests/api-measurement-set-tests.js