Changeset 192760 in webkit
- Timestamp:
- Nov 23, 2015, 11:13:03 PM (10 years ago)
- Location:
- trunk/Websites/perf.webkit.org
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/perf.webkit.org/ChangeLog
r192717 r192760 1 2015-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 1 19 2015-11-20 Ryosuke Niwa <rniwa@webkit.org> 2 20 -
trunk/Websites/perf.webkit.org/public/api/runs.php
r192717 r192760 11 11 exit_with_error('InvalidRequest'); 12 12 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 17 13 $db = new Database; 18 14 if (!$db->connect()) 19 15 exit_with_error('DatabaseConnectionFailure'); 20 21 if ($test_group_id)22 $generator = new RunsGeneratorForTestGroup($db, $test_group_id);23 else24 $generator = new RunsGenerator($db);25 16 26 17 $platform_id = intval($parts[0]); … … 31 22 exit_with_error('ConfigurationNotFound'); 32 23 24 $test_group_id = array_get($_GET, 'testGroup'); 25 $should_cache = array_get($_GET, 'cache'); 33 26 if ($test_group_id) 34 27 $test_group_id = intval($test_group_id); … … 39 32 } 40 33 34 if ($test_group_id) 35 $generator = new RunsGeneratorForTestGroup($db, $test_group_id); 36 else 37 $generator = new RunsGenerator($db); 38 41 39 foreach ($config_rows as $config) 42 40 $generator->fetch_runs($config['config_type'], $config['config_id'], $config['config_runs_last_modified']); 43 41 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()); 51 43 if (!$test_group_id) 52 44 generate_data_file("$platform_id-$metric_id.json", $content); … … 72 64 $this->last_modified = max($this->last_modified, Database::to_js_time($last_modified)); 73 65 74 $beginning_of_time = intval(time() - 366 * 24 * 3600) * 1000;75 76 66 $results = $this->execute_query($config_id); 77 67 78 68 $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)); 87 71 88 72 $this->results[$name] = $formatted_runs; … … 99 83 } 100 84 101 private static function format_run($run , $build_time, $revisions) {85 private static function format_run($run) { 102 86 return array( 103 87 'id' => intval($run['run_id']), … … 107 91 'squareSum' => floatval($run['run_square_sum_cache']), 108 92 'markedOutlier' => Database::is_true($run['run_marked_outlier']), 109 'revisions' => $revisions,93 'revisions' => self::parse_revisions_array($run['revisions']), 110 94 'build' => $run['build_id'], 111 'buildTime' => $build_time,95 'buildTime' => Database::to_js_time($run['build_time']), 112 96 'buildNumber' => intval($run['build_number']), 113 97 'builder' => $run['build_builder']); 114 98 } 115 99 116 private static function parse_revisions_array($postgres_array , &$max_time) {100 private static function parse_revisions_array($postgres_array) { 117 101 // e.g. {"(WebKit,131456,\"2012-10-16 14:53:00\")","(Chromium,162004,)"} 118 102 $outer_array = json_decode('[' . trim($postgres_array, '{}') . ']'); … … 123 107 continue; 124 108 $time = Database::to_js_time(trim($name_and_revision[2], '"')); 125 $max_time = max($max_time, $time);126 109 $revisions[trim($name_and_revision[0], '"')] = array(trim($name_and_revision[1], '"'), $time); 127 110 }
Note:
See TracChangeset
for help on using the changeset viewer.