Changeset 192760 in webkit


Ignore:
Timestamp:
Nov 23, 2015, 11:13:03 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r192716 and r192717.
https://bugs.webkit.org/show_bug.cgi?id=151582

The patch was incorrect. We always need at least one data
point in each configuration (Requested by rniwa on #webkit).

Reverted changesets:

"Perf dashboard's should not include results more than 366
days old in JSON"
https://bugs.webkit.org/show_bug.cgi?id=151529
http://trac.webkit.org/changeset/192716

"Build fix for old version of PHP."
http://trac.webkit.org/changeset/192717

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

Legend:

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

    r192717 r192760  
     12015-11-23  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r192716 and r192717.
     4        https://bugs.webkit.org/show_bug.cgi?id=151582
     5
     6        The patch was incorrect. We always need at least one data
     7        point in each configuration (Requested by rniwa on #webkit).
     8
     9        Reverted changesets:
     10
     11        "Perf dashboard's should not include results more than 366
     12        days old in JSON"
     13        https://bugs.webkit.org/show_bug.cgi?id=151529
     14        http://trac.webkit.org/changeset/192716
     15
     16        "Build fix for old version of PHP."
     17        http://trac.webkit.org/changeset/192717
     18
    1192015-11-20  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/Websites/perf.webkit.org/public/api/runs.php

    r192717 r192760  
    1111        exit_with_error('InvalidRequest');
    1212
    13     $test_group_id = array_get($_GET, 'testGroup');
    14     $should_cache = array_get($_GET, 'cache');
    15     $should_echo_results = !array_key_exists('noResult', $_GET);
    16 
    1713    $db = new Database;
    1814    if (!$db->connect())
    1915        exit_with_error('DatabaseConnectionFailure');
    20 
    21     if ($test_group_id)
    22         $generator = new RunsGeneratorForTestGroup($db, $test_group_id);
    23     else
    24         $generator = new RunsGenerator($db);
    2516
    2617    $platform_id = intval($parts[0]);
     
    3122        exit_with_error('ConfigurationNotFound');
    3223
     24    $test_group_id = array_get($_GET, 'testGroup');
     25    $should_cache = array_get($_GET, 'cache');
    3326    if ($test_group_id)
    3427        $test_group_id = intval($test_group_id);
     
    3932    }
    4033
     34    if ($test_group_id)
     35        $generator = new RunsGeneratorForTestGroup($db, $test_group_id);
     36    else
     37        $generator = new RunsGenerator($db);
     38
    4139    foreach ($config_rows as $config)
    4240        $generator->fetch_runs($config['config_type'], $config['config_id'], $config['config_runs_last_modified']);
    4341
    44     $results = $generator->results();
    45     $content = success_json($results);
    46     if (!$should_echo_results) {
    47         echo $results['elapsedTime'];
    48         return;
    49     }
    50 
     42    $content = success_json($generator->results());
    5143    if (!$test_group_id)
    5244        generate_data_file("$platform_id-$metric_id.json", $content);
     
    7264        $this->last_modified = max($this->last_modified, Database::to_js_time($last_modified));
    7365
    74         $beginning_of_time = intval(time() - 366 * 24 * 3600) * 1000;
    75 
    7666        $results = $this->execute_query($config_id);
    7767
    7868        $formatted_runs = array();
    79         while ($row = $this->db->fetch_next_row($results)) {
    80             $build_time = Database::to_js_time($row['build_time']);
    81             $max_time = $build_time;
    82             $revisions = self::parse_revisions_array($row['revisions'], $max_time);
    83             if ($max_time < $beginning_of_time)
    84                 continue;
    85             array_push($formatted_runs, self::format_run($row, $build_time, $revisions));
    86         }
     69        while ($row = $this->db->fetch_next_row($results))
     70            array_push($formatted_runs, self::format_run($row));
    8771
    8872        $this->results[$name] = $formatted_runs;
     
    9983    }
    10084
    101     private static function format_run($run, $build_time, $revisions) {
     85    private static function format_run($run) {
    10286        return array(
    10387            'id' => intval($run['run_id']),
     
    10791            'squareSum' => floatval($run['run_square_sum_cache']),
    10892            'markedOutlier' => Database::is_true($run['run_marked_outlier']),
    109             'revisions' => $revisions,
     93            'revisions' => self::parse_revisions_array($run['revisions']),
    11094            'build' => $run['build_id'],
    111             'buildTime' => $build_time,
     95            'buildTime' => Database::to_js_time($run['build_time']),
    11296            'buildNumber' => intval($run['build_number']),
    11397            'builder' => $run['build_builder']);
    11498    }
    11599
    116     private static function parse_revisions_array($postgres_array, &$max_time) {
     100    private static function parse_revisions_array($postgres_array) {
    117101        // e.g. {"(WebKit,131456,\"2012-10-16 14:53:00\")","(Chromium,162004,)"}
    118102        $outer_array = json_decode('[' . trim($postgres_array, '{}') . ']');
     
    123107                continue;
    124108            $time = Database::to_js_time(trim($name_and_revision[2], '"'));
    125             $max_time = max($max_time, $time);
    126109            $revisions[trim($name_and_revision[0], '"')] = array(trim($name_and_revision[1], '"'), $time);
    127110        }
Note: See TracChangeset for help on using the changeset viewer.