Exemplo n.º 1
0
<script type="text/javascript">
// HTML strings for each image
var gaSnippets = new Array();

<?php 
$gLabel = latestLabel();
require_once "stats.inc";
require_once "charts.inc";
$hStats = getStats($gLabel, "All", curDevice());
?>
gaSnippets.push("<?php 
echo bytesContentTypeChart($hStats);
?>
");
gaSnippets.push("<?php 
echo responseSizes($hStats);
?>
");
gaSnippets.push("<?php 
echo percentGoogleLibrariesAPI($hStats);
?>
");
gaSnippets.push("<?php 
echo percentFlash($hStats);
?>
");
gaSnippets.push("<?php 
echo percentFonts($hStats);
?>
");
gaSnippets.push("<?php 
Exemplo n.º 2
0
<form>
	<label>Choose URLs:</label>
<?php 
echo selectSlice($gSlice, "onchange='document.location=\"?a={$gArchive}&l={$gLabel}&s=\"+escape(this.options[this.selectedIndex].value)'");
?>
</form>

<div id=interesting style="margin-top: 40px;">
<?php 
require_once "stats.inc";
require_once "charts.inc";
$hStats = getStats($gLabel, $gSlice, curDevice());
$hCdf = getCdfData($gLabel, $gSlice, curDevice());
echo bytesContentTypeChart($hStats) . "\n";
echo responseSizes($hStats) . "\n";
echo histogram($hCdf, "bytesHtmlDoc", "HTML Document Transfer Size", "bytesHtmlDoc", 5 * 1024) . "\n";
echo histogram($hCdf, "numDomElements", "# of DOM Elements per Page", "numDomElements", 400, 2) . "\n";
echo percentGoogleLibrariesAPI($hStats) . "\n";
echo percentFlash($hStats) . "\n";
echo percentFonts($hStats) . "\n";
echo popularImageFormats($hStats) . "\n";
echo maxage($hStats) . "\n";
echo histogram($hCdf, "numRedirects", "Redirects per Page", "redirects") . "\n";
echo histogram($hCdf, "_connections", "Connections per Page", "connections", 10) . "\n";
echo histogram($hCdf, "avg_dom_depth", "Avg DOM Depth", "avgdomdepth") . "\n";
echo histogram($hCdf, "document_height", "Document Height (pixels)", "docheight", 1000) . "\n";
echo histogram($hCdf, "localstorage_size", "Size of localStorage (chars)", "localstorage", 50) . "\n";
echo histogram($hCdf, "sessionstorage_size", "Size of sessionStorage (chars)", "sessionstorage", 50) . "\n";
echo histogram($hCdf, "num_iframes", "Iframes per Page", "numiframes") . "\n";
echo histogram($hCdf, "num_scripts", "Script Tags per Page", "numscripts", 10) . "\n";