Ejemplo n.º 1
0
    echo "    </html>";
}
if ($_REQUEST['startDate']) {
    $reportDateStart = $_REQUEST['startDate'];
    //date("y/m/d", strtotime($_REQUEST['startDate']));
} else {
    $reportDateStart = date('Y/m/d');
}
if ($_REQUEST['endDate']) {
    $reportDateEnd = $_REQUEST['endDate'];
    //date("y/m/d", strtotime($_REQUEST['endDate']));
} else {
    $reportDateEnd = $reportDateStart;
}
$results = array();
$infos = getResultIDs($reportDateStart, $reportDateEnd);
foreach ($infos as $info) {
    $id = $info["id"];
    $date = substr($info["date"], 2);
    $resultXml = file_get_contents(getBaseURL() . "/xmlResult/{$id}/");
    if (!$resultXml) {
        continue;
    }
    $ix = strrpos($id, "_") + 1;
    $shortId = substr($id, $ix);
    // If no label file then skip it
    if (!file_exists("/var/www/html/results/" . $date . "/{$shortId}/label.txt")) {
        continue;
    }
    $resultLabel = file_get_contents("/var/www/html/results/" . $date . "/{$shortId}/label.txt");
    $xml = new SimpleXMLElement($resultXml);
Ejemplo n.º 2
0
<?php

include 'xml.php';
header("Content-Type: text/csv");
header("Content-Disposition: attachment; filename=\"data.csv\"");
$reportDate = date("y/m/d");
$summary = FALSE;
if ($_REQUEST['dte']) {
    $reportDate = date("y/m/d", strtotime($_REQUEST['dte']));
}
if ($_REQUEST['summary']) {
    $summary = TRUE;
}
$results = array();
$infos = getResultIDs($reportDate);
if (!$summary) {
    echo "label, start time, end time, url, status code, load time, ttfb, requests, requests doc, start render, fully loaded, doc loaded time, adjusted start render, adjusted fully loaded";
    echo "\n";
}
foreach ($infos as $info) {
    $id = $info["id"];
    $resultXml = file_get_contents(getBaseURL() . "/xmlResult/{$id}/");
    $ix = strrpos($id, "_") + 1;
    $shortId = substr($id, $ix);
    $resultLabel = file_get_contents("/var/www/html/results/{$reportDate}/{$shortId}/label.txt");
    $xml = new SimpleXMLElement($resultXml);
    $firstView = $xml->data->average->firstView;
    $url = $xml->data->run->firstView->results->URL;
    if ($firstView->loadTime && $firstView->bytesIn > 275) {
        $item = array();
        $item["label"] = $resultLabel;