function GetCSIData() { global $id; global $testPath; global $runs; global $testInfo; $csi = array(); $csi['fv'] = array(); for ($run = 1; $run <= $runs; $run++) { $params = ParseCsiInfo($id, $testPath, $run, 0, true); foreach ($params as $name => $value) { if (!array_key_exists($name, $csi['fv'])) { $csi['fv'][$name] = array(); } $csi['fv'][$name][$run] = $value; } } if (!$testInfo['fvonly']) { $csi['rv'] = array(); for ($run = 1; $run <= $runs; $run++) { $params = ParseCsiInfo($id, $testPath, $run, 1, true); foreach ($params as $name => $value) { if (!array_key_exists($name, $csi['rv'])) { $csi['rv'][$name] = array(); } $csi['rv'][$name][$run] = $value; } } } return $csi; }
/** * Function for parsing/outputting the CSI data for a given run */ function ParseCsiForRun($id, $testPath, $run, $cached, &$data) { $params = ParseCsiInfo($id, $testPath, $run, $cached, true); if (!is_null($data)) { OutputJsonFromParams($id, $run, $cached, $params, $data); } else { OutputCsvFromParams($id, $run, $cached, $params); } }
$testInfo['errors'][$runNumber][$cacheWarmed] = $_REQUEST['error']; $testInfo_dirty = true; } // Do any post-processing on this individual run that doesn't requre the test to be locked if (isset($runNumber) && isset($cacheWarmed)) { $secure = false; $haveLocations = false; $requests = getRequests($id, $testPath, $runNumber, $cacheWarmed, $secure, $haveLocations, false); if (isset($requests) && is_array($requests) && count($requests)) { getBreakdown($id, $testPath, $runNumber, $cacheWarmed, $requests); } else { $testerError = 'Missing Results'; } if (is_dir('./google') && is_file('./google/google_lib.inc')) { require_once 'google/google_lib.inc'; ParseCsiInfo($id, $testPath, $runNumber, $cacheWarmed, true); } GetDevToolsCPUTime($testPath, $runNumber, $cacheWarmed); } // mark this run as complete if (isset($runNumber) && isset($cacheWarmed)) { if ($testInfo['fvonly'] || $cacheWarmed) { if (!array_key_exists('test_runs', $testInfo)) { $testInfo['test_runs'] = array(); } if (array_key_exists($runNumber, $testInfo['test_runs'])) { $testInfo['test_runs'][$runNumber]['done'] = true; } else { $testInfo['test_runs'][$runNumber] = array('done' => true); } $testInfo_dirty = true;
echo "<td id=\"domElements\" valign=\"middle\">{$data['domElements']}</td>\n"; } echo "<td id=\"result\" valign=\"middle\">{$data['result']}</td>\n"; echo "<td id=\"docComplete\" class=\"border\" valign=\"middle\">" . formatMsInterval($data['docTime'], 3) . "</td>\n"; echo "<td id=\"requestsDoc\" valign=\"middle\">{$data['requestsDoc']}</td>\n"; echo "<td id=\"bytesInDoc\" valign=\"middle\">" . number_format($data['bytesInDoc'] / 1024, 0) . " KB</td>\n"; echo "<td id=\"fullyLoaded\" class=\"border\" valign=\"middle\">" . formatMsInterval($data['fullyLoaded'], 3) . "</td>\n"; echo "<td id=\"requests\" valign=\"middle\">{$data['requests']}</td>\n"; echo "<td id=\"bytesIn\" valign=\"middle\">" . number_format($data['bytesIn'] / 1024, 0) . " KB</td>\n"; ?> </tr> </table><br> <?php if (is_dir('./google') && isset($test['testinfo']['extract_csi'])) { require_once 'google/google_lib.inc'; $params = ParseCsiInfo($id, $testPath, $run, $_GET["cached"], true); ?> <h2>Csi Metrics</h2> <table id="tableCustomMetrics" class="pretty" align="center" border="1" cellpadding="10" cellspacing="0"> <tr> <?php foreach ($test['testinfo']['extract_csi'] as $csi_param) { echo '<th align="center" class="border" valign="middle">' . $csi_param . '</th>'; } echo '</tr><tr>'; foreach ($test['testinfo']['extract_csi'] as $csi_param) { if (array_key_exists($csi_param, $params)) { echo '<td class="even" valign="middle">' . $params[$csi_param] . '</td>'; } else { echo '<td class="even" valign="middle"></td>'; }