Bugfixing after adding timestamps

This commit is contained in:
Michael Vogel 2013-01-27 13:57:44 +01:00
parent fdee002f73
commit 2cb576d305
8 changed files with 72 additions and 65 deletions

View file

@ -418,6 +418,8 @@ if(! class_exists('App')) {
$this->performance["network"] = 0;
$this->performance["rendering"] = 0;
$this->performance["parser"] = 0;
$this->performance["marktime"] = 0;
$this->performance["markstart"] = microtime(true);
$this->config = array();
$this->page = array();
@ -726,12 +728,17 @@ if(! class_exists('App')) {
return $this->rdelim[$engine];
}
function save_timestamp($stamp1, $value) {
$stamp2 = microtime(true);
$duration = (float)($stamp2-$stamp1);
function save_timestamp($stamp, $value) {
$duration = (float)(microtime(true)-$stamp);
$this->performance[$value] += (float)$duration;
$this->performance["marktime"] += (float)$duration;
}
function mark_timestamp($mark) {
//$this->performance["markstart"] -= microtime(true) - $this->performance["marktime"];
$this->performance["markstart"] = microtime(true) - $this->performance["markstart"] - $this->performance["marktime"];
}
}
}

View file

@ -368,7 +368,6 @@ function visible_activity($item) {
if(!function_exists('conversation')) {
function conversation(&$a, $items, $mode, $update, $preview = false) {
require_once('include/bbcode.php');
$ssl_state = ((local_user()) ? true : false);

View file

@ -195,6 +195,9 @@ function call_hooks($name, &$data = null) {
if (! function_exists('get_plugin_info')){
function get_plugin_info($plugin){
$a = get_app();
$info=Array(
'name' => $plugin,
'description' => "",
@ -270,6 +273,7 @@ function get_theme_info($theme){
if (!is_file("view/theme/$theme/theme.php")) return $info;
$a = get_app();
$stamp1 = microtime(true);
$f = file_get_contents("view/theme/$theme/theme.php");
$a->save_timestamp($stamp1, "file");

View file

@ -39,9 +39,7 @@ function replace_macros($s,$r) {
$output = template_unescape($r);
}
$a = get_app();
$stamp2 = microtime(true);
$duration = (float)($stamp2-$stamp1);
$a->performance["rendering"] += (float)$duration;
$a->save_timestamp($stamp1, "rendering");
return $output;
}}

View file

@ -130,7 +130,6 @@ function admin_content(&$a) {
* Page content
*/
$o = '';
// urls
if ($a->argc > 1){
switch ($a->argv[1]){
@ -775,7 +774,7 @@ function admin_page_plugins(&$a){
}
if (x($_GET,"a") && $_GET['a']=="t"){
check_form_security_token_redirectOnErr('/admin/plugins', 'admin_themes', 't');
check_form_security_token_redirectOnErr('/admin/plugins', 'admin_themes', 't');
// Toggle plugin status
$idx = array_search($plugin, $a->plugins);
@ -817,6 +816,7 @@ function admin_page_plugins(&$a){
}
$t = get_markup_template("admin_plugins_details.tpl");
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Plugins'),
@ -836,7 +836,7 @@ function admin_page_plugins(&$a){
'$screenshot' => '',
'$readme' => $readme,
'$form_security_token' => get_form_security_token("admin_themes"),
'$form_security_token' => get_form_security_token("admin_themes"),
));
}
@ -974,7 +974,7 @@ function admin_page_themes(&$a){
}
if (x($_GET,"a") && $_GET['a']=="t"){
check_form_security_token_redirectOnErr('/admin/themes', 'admin_themes', 't');
check_form_security_token_redirectOnErr('/admin/themes', 'admin_themes', 't');
// Toggle theme status
@ -1016,7 +1016,6 @@ function admin_page_themes(&$a){
}
$screenshot = array( get_theme_screenshot($theme), t('Screenshot'));
if(! stristr($screenshot[0],$theme))
$screenshot = null;
@ -1044,8 +1043,6 @@ function admin_page_themes(&$a){
));
}
/**
* List themes
*/

View file

@ -571,7 +571,7 @@ function network_content(&$a, $update = 0) {
}
// We don't have to deal with ACL's on this page. You're looking at everything
// We don't have to deal with ACLs on this page. You're looking at everything
// that belongs to you, hence you can see all of it. We will filter by group if
// desired.

View file

@ -127,6 +127,7 @@ class Conversation extends BaseObject {
* _ false on failure
*/
public function get_template_data($alike, $dlike) {
global $a;
$result = array();
foreach($this->threads as $item) {
@ -140,6 +141,7 @@ class Conversation extends BaseObject {
$result[] = $item_data;
}
//$a->mark_timestamp();
return $result;
}