Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(61)

Side by Side Diff: www/benchmarks/trendurl.php

Issue 110240045: Add links to filmstrip and graph comparison views from trendurl.php Base URL: https://github.com/geening/webpagetest.git@master
Patch Set: Created 11 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <?php 1 <?php
2 chdir('..'); 2 chdir('..');
3 include 'common.inc'; 3 include 'common.inc';
4 include './benchmarks/data.inc.php'; 4 include './benchmarks/data.inc.php';
5 $page_keywords = array('Benchmarks','Webpagetest','Website Speed Test','Page Spe ed'); 5 $page_keywords = array('Benchmarks','Webpagetest','Website Speed Test','Page Spe ed');
6 $page_description = "WebPagetest benchmark details"; 6 $page_description = "WebPagetest benchmark details";
7 $aggregate = 'median'; 7 $aggregate = 'median';
8 if (array_key_exists('aggregate', $_REQUEST)) 8 if (array_key_exists('aggregate', $_REQUEST))
9 $aggregate = $_REQUEST['aggregate']; 9 $aggregate = $_REQUEST['aggregate'];
10 $benchmark = ''; 10 $benchmark = '';
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 <option value="183" <?php if ($days == 183) echo "se lected"; ?>>6 Months</option> 64 <option value="183" <?php if ($days == 183) echo "se lected"; ?>>6 Months</option>
65 <option value="366" <?php if ($days == 366) echo "se lected"; ?>>Year</option> 65 <option value="366" <?php if ($days == 366) echo "se lected"; ?>>Year</option>
66 <option value="all" <?php if ($days == 0) echo "sele cted"; ?>>All</option> 66 <option value="all" <?php if ($days == 0) echo "sele cted"; ?>>All</option>
67 </select> 67 </select>
68 </form> 68 </form>
69 </div> 69 </div>
70 </div> 70 </div>
71 <div style="clear:both;"> 71 <div style="clear:both;">
72 </div> 72 </div>
73 <script type="text/javascript"> 73 <script type="text/javascript">
74 function SelectedPoint(meta, time) { 74 function SelectedPoint(meta, time, cached) {
75 <?php 75 <?php
76 echo "var url = \"$url\";\n"; 76 echo "var url = \"$url\";\n";
77 echo "var medianMetric=\"$median_metric\";\n"; 77 echo "var medianMetric=\"$median_metric\";\n";
78 ?> 78 ?>
79 var menu = '<div><h4>View test for ' + url + '</h4>'; 79 var menu = '<div><h4>View test for ' + url + '</h4>';
80 var compare = "/video/compare.php?ival=100&medianMetric=" + medi anMetric + "&tests=";
81 var graph_compare = "/graph_page_data.php?tests=";
80 time = parseInt(time / 1000, 10); 82 time = parseInt(time / 1000, 10);
81 var ok = false; 83 var ok = false;
82 if (meta[time] != undefined) { 84 if (meta[time] != undefined) {
83 for(i = 0; i < meta[time].length; i++) { 85 for(i = 0; i < meta[time].length; i++) {
84 ok = true; 86 ok = true;
85 menu += '<a href="/result/' + meta[time][i]['test'] + '/ ?medianMetric=' + medianMetric + '" target="_blank">' + meta[time][i]['label'] + '</a><br>'; 87 menu += '<a href="/result/' + meta[time][i]['test'] + '/ ?medianMetric=' + medianMetric + '" target="_blank">' + meta[time][i]['label'] + '</a><br>';
88 if (i) {
89 compare += ",";
90 graph_compare += ",";
91 }
92 compare += encodeURIComponent(meta[time][i]['test'] + "-l:" + meta[time][i]['label'].replace("-","").replace(":","") + "-c:" + (cach ed ? 1 : 0));
93 graph_compare += encodeURIComponent(meta[time][i]['t est'] + "-l:" + meta[time][i]['label'].replace("-","").replace(":",""));
86 } 94 }
95 graph_compare += "&" + (cached ? "rv" : "fv") + "=1";
96 menu += '<br><a href="' + compare + '">Filmstrip Comparison< /a>';
97 menu += '<br><a href="' + graph_compare + '">Graph Compariso n</a>';
87 } 98 }
88 menu += '</div>'; 99 menu += '</div>';
89 if (ok) { 100 if (ok) {
90 $.modal(menu, {overlayClose:true}); 101 $.modal(menu, {overlayClose:true});
91 } 102 }
92 } 103 }
93 </script> 104 </script>
94 <?php 105 <?php
95 } 106 }
96 $metrics = array('docTime' => 'Load Time (onload)',· 107 $metrics = array('docTime' => 'Load Time (onload)',·
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 var {$id}meta = " . json_encode($meta) . "; 225 var {$id}meta = " . json_encode($meta) . ";
215 $id = new Dygraph( 226 $id = new Dygraph(
216 document.getElementById(\"$id\"), 227 document.getElementById(\"$id\"),
217 \"" . str_replace("\t", '\t', str_replace("\n", '\n', $tsv)) . "\", 228 \"" . str_replace("\t", '\t', str_replace("\n", '\n', $tsv)) . "\",
218 {drawPoints: true, 229 {drawPoints: true,
219 rollPeriod: 1, 230 rollPeriod: 1,
220 showRoller: true, 231 showRoller: true,
221 labelsSeparateLines: true, 232 labelsSeparateLines: true,
222 colors: ['#ed2d2e', '#008c47', '#1859a9', '#662c91', '#f37d2 2', '#a11d20', '#b33893', '#010101'], 233 colors: ['#ed2d2e', '#008c47', '#1859a9', '#662c91', '#f37d2 2', '#a11d20', '#b33893', '#010101'],
223 labelsDiv: document.getElementById('{$id}_legend'), 234 labelsDiv: document.getElementById('{$id}_legend'),
224 pointClickCallback: function(e, p) {SelectedPoint({$id}meta, p.xval);}, 235 pointClickCallback: function(e, p) {SelectedPoint({$id}meta, p.xval, false);},
225 $chart_title 236 $chart_title
226 legend: \"always\"} 237 legend: \"always\"}
227 );"; 238 );";
228 if (isset($annotations) && count($annotations)) { 239 if (isset($annotations) && count($annotations)) {
229 echo "$id.setAnnotations(" . json_encode($annotations) . ");\n"; 240 echo "$id.setAnnotations(" . json_encode($annotations) . ");\n";
230 } 241 }
231 echo "</script>\n"; 242 echo "</script>\n";
232 } 243 }
233 if (!array_key_exists('fvonly', $benchmark) || !$benchmark['fvonly']) { 244 if (!array_key_exists('fvonly', $benchmark) || !$benchmark['fvonly']) {
234 if (isset($title)) 245 if (isset($title))
(...skipping 24 matching lines...) Expand all
259 var {$id}meta = " . json_encode($meta) . "; 270 var {$id}meta = " . json_encode($meta) . ";
260 $id = new Dygraph( 271 $id = new Dygraph(
261 document.getElementById(\"$id\"), 272 document.getElementById(\"$id\"),
262 \"" . str_replace("\t", '\t', str_replace("\n", '\n', $t sv)) . "\", 273 \"" . str_replace("\t", '\t', str_replace("\n", '\n', $t sv)) . "\",
263 {drawPoints: true, 274 {drawPoints: true,
264 rollPeriod: 1, 275 rollPeriod: 1,
265 showRoller: true, 276 showRoller: true,
266 labelsSeparateLines: true, 277 labelsSeparateLines: true,
267 colors: ['#ed2d2e', '#008c47', '#1859a9', '#662c91', '#f 37d22', '#a11d20', '#b33893', '#010101'], 278 colors: ['#ed2d2e', '#008c47', '#1859a9', '#662c91', '#f 37d22', '#a11d20', '#b33893', '#010101'],
268 labelsDiv: document.getElementById('{$id}_legend'), 279 labelsDiv: document.getElementById('{$id}_legend'),
269 pointClickCallback: function(e, p) {SelectedPoint({$id}m eta, p.xval);}, 280 pointClickCallback: function(e, p) {SelectedPoint({$id}m eta, p.xval, true);},
270 $chart_title 281 $chart_title
271 legend: \"always\"} 282 legend: \"always\"}
272 );"; 283 );";
273 if (isset($annotations) && count($annotations)) { 284 if (isset($annotations) && count($annotations)) {
274 echo "$id.setAnnotations(" . json_encode($annotations) . ");\n"; 285 echo "$id.setAnnotations(" . json_encode($annotations) . ");\n";
275 } 286 }
276 echo "</script>\n"; 287 echo "</script>\n";
277 } 288 }
278 } 289 }
279 }···· 290 }····
280 ?> 291 ?>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b