From 2b35c5d8f6526c86d356913f151af7e6df3c2976 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 29 Jan 2010 04:36:06 -0500
Subject: [PATCH] - performance stats logging in devel_mode
---
program/include/rcmail.php | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index e3c8261..3d26065 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -853,6 +853,17 @@
// before closing the database connection, write session data
if ($_SERVER['REMOTE_ADDR'])
session_write_close();
+
+ // write performance stats to logs/console
+ if ($this->config->get('devel_mode')) {
+ if (function_exists('memory_get_usage'))
+ $mem = show_bytes(memory_get_usage());
+ if (function_exists('memory_get_peak_usage'))
+ $mem .= '/'.show_bytes(memory_get_peak_usage());
+
+ $log = $this->task . ($this->action ? '/'.$this->action : '') . ($mem ? " [$mem]" : '');
+ rcube_print_time(RCMAIL_START, $log);
+ }
}
--
Gitblit v1.9.1