1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-08-05 23:57:30 +02:00

more test

This commit is contained in:
Mikael Roos
2016-08-08 10:39:11 +02:00
parent b1d0cb1506
commit 72c04632b8
13 changed files with 120 additions and 23 deletions

View File

@@ -14,15 +14,15 @@
*/
function trace($msg)
{
$file = "/tmp/cimage";
$file = CIMAGE_DEBUG_FILE;
if (!is_writable($file)) {
die("Using trace without a writable logfile. Create the file '$file' and make it writable for the web server.");
}
$msg .= ":" . count(get_included_files());
$msg .= ":" . round(memory_get_peak_usage()/1024/1024, 3) . "MB";
$msg .= ":" . (string) round((microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"]), 6) . "ms";
file_put_contents($file, "$msg\n", FILE_APPEND);
$details = ":" . (string) round((microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"]), 6) . "ms";
$details .= ":" . round(memory_get_peak_usage()/1024/1024, 3) . "MB";
$details .= ":" . count(get_included_files());
file_put_contents($file, "$details:$msg\n", FILE_APPEND);
}