/** * Prepare performance data to be displayed * * @return void */ static function preparePerformance() { arsort(CStoredObject::$cachableCounts); arsort(CStoredObject::$objectCounts); arsort(self::$performance["autoload"]); self::$performance["genere"] = round(self::$chrono->total, 3); self::$performance["memoire"] = CHTMLResourceLoader::getOutputMemory(); self::$performance["objets"] = CStoredObject::$objectCount; self::$performance["cachableCount"] = array_sum(CMbObject::$cachableCounts); self::$performance["cachableCounts"] = CStoredObject::$cachableCounts; self::$performance["objectCounts"] = CStoredObject::$objectCounts; self::$performance["ip"] = $_SERVER["SERVER_ADDR"]; self::$performance["size"] = CHTMLResourceLoader::getOutputLength(); self::$performance["cache"] = array("totals" => Cache::$totals, "total" => Cache::$total); self::$performance["enslaved"] = CView::$enslaved; $time = 0; // Data sources performance foreach (CSQLDataSource::$dataSources as $dsn => $ds) { if (!$ds) { continue; } $chrono = $ds->chrono; $chronoFetch = $ds->chronoFetch; $time += $chrono->total + $chronoFetch->total; self::$performance["dataSources"][$dsn] = array("count" => $chrono->nbSteps, "time" => $chrono->total, "countFetch" => $chronoFetch->nbSteps, "timeFetch" => $chronoFetch->total); } self::$performance["dataSourceTime"] = $time; }