unset($db_host, $db_user, $db_pass, $db_data, $charset);
- $this->profiler->saveTimestamp($stamp1, 'network');
+ $this->profiler->saveTimestamp($stamp1, 'network', Core\System::callstack());
}
public function getScheme()
if (!$this->isBackend()) {
$stamp1 = microtime(true);
session_start();
- $this->profiler->saveTimestamp($stamp1, 'parser');
+ $this->profiler->saveTimestamp($stamp1, 'parser', Core\System::callstack());
Core\L10n::setSessionVariable();
Core\L10n::setLangFromSession();
} else {
@curl_exec($ch);
$curl_info = @curl_getinfo($ch);
- $a->getProfiler()->saveTimestamp($stamp1, "network");
+ $a->getProfiler()->saveTimestamp($stamp1, "network", System::callstack());
if (substr($curl_info["content_type"], 0, 6) == "image/") {
$text = "[url=" . $match[1] . "]" . $match[1] . "[/url]";
@curl_exec($ch);
$curl_info = @curl_getinfo($ch);
- $a->getProfiler()->saveTimestamp($stamp1, "network");
+ $a->getProfiler()->saveTimestamp($stamp1, "network", System::callstack());
// if its a link to a picture then embed this picture
if (substr($curl_info["content_type"], 0, 6) == "image/") {
// unmask the special chars back to HTML
$text = str_replace(['&\_lt\_;', '&\_gt\_;', '&\_amp\_;'], ['<', '>', '&'], $text);
- $a->getProfiler()->saveTimestamp($stamp1, "parser");
+ $a->getProfiler()->saveTimestamp($stamp1, "parser", System::callstack());
// Libertree has a problem with escaped hashtags.
$text = str_replace(['\#'], ['#'], $text);
namespace Friendica\Content\Text;
use Friendica\BaseObject;
+use Friendica\Core\System;
use Friendica\Model\Contact;
use Michelf\MarkdownExtra;
$html = $MarkdownParser->transform($text);
$html = preg_replace('/<a(.*?)href="#/is', '<a$1href="' . ltrim($_SERVER['REQUEST_URI'], '/') . '#', $html);
- self::getApp()->getProfiler()->saveTimestamp($stamp1, "parser");
+ self::getApp()->getProfiler()->saveTimestamp($stamp1, "parser", System::callstack());
return $html;
}
$stamp1 = microtime(true);
$f = file_get_contents("addon/$addon/$addon.php");
- $a->getProfiler()->saveTimestamp($stamp1, "file");
+ $a->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
$r = preg_match("|/\*.*\*/|msU", $f, $m);
$return = self::getDriver()->getAllKeys($prefix);
- self::getApp()->getProfiler()->saveTimestamp($time, 'cache');
+ self::getApp()->getProfiler()->saveTimestamp($time, 'cache', System::callstack());
return $return;
}
$return = self::getDriver()->get($key);
- self::getApp()->getProfiler()->saveTimestamp($time, 'cache');
+ self::getApp()->getProfiler()->saveTimestamp($time, 'cache', System::callstack());
return $return;
}
$return = self::getDriver()->set($key, $value, $duration);
- self::getApp()->getProfiler()->saveTimestamp($time, 'cache_write');
+ self::getApp()->getProfiler()->saveTimestamp($time, 'cache_write', System::callstack());
return $return;
}
$return = self::getDriver()->delete($key);
- self::getApp()->getProfiler()->saveTimestamp($time, 'cache_write');
+ self::getApp()->getProfiler()->saveTimestamp($time, 'cache_write', System::callstack());
return $return;
}
$stamp1 = microtime(true);
self::$logger->emergency($message, $context);
- self::getApp()->GetProfiler()->saveTimestamp($stamp1, 'file');
+ self::getApp()->GetProfiler()->saveTimestamp($stamp1, 'file', System::callstack());
}
/**
$stamp1 = microtime(true);
self::$logger->alert($message, $context);
- self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file');
+ self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file', System::callstack());
}
/**
$stamp1 = microtime(true);
self::$logger->critical($message, $context);
- self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file');
+ self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file', System::callstack());
}
/**
$stamp1 = microtime(true);
self::$logger->error($message, $context);
- self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file');
+ self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file', System::callstack());
}
/**
$stamp1 = microtime(true);
self::$logger->warning($message, $context);
- self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file');
+ self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file', System::callstack());
}
/**
$stamp1 = microtime(true);
self::$logger->notice($message, $context);
- self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file');
+ self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file', System::callstack());
}
/**
$stamp1 = microtime(true);
self::$logger->info($message, $context);
- self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file');
+ self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file', System::callstack());
}
/**
$stamp1 = microtime(true);
self::$logger->debug($message, $context);
- self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file');
+ self::getApp()->getProfiler()->saveTimestamp($stamp1, 'file', System::callstack());
}
/**
$stamp1 = microtime(true);
self::$logger->log($level, $msg);
- self::getApp()->getProfiler()->saveTimestamp($stamp1, "file");
+ self::getApp()->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
}
/**
$stamp1 = microtime(true);
self::$devLogger->log($level, $msg);
- self::getApp()->getProfiler()->saveTimestamp($stamp1, "file");
+ self::getApp()->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
}
}
exit();
}
- $a->getProfiler()->saveTimestamp($stamp1, "rendering");
+ $a->getProfiler()->saveTimestamp($stamp1, "rendering", System::callstack());
return $output;
}
exit();
}
- $a->getProfiler()->saveTimestamp($stamp1, "file");
+ $a->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
return $template;
}
$a = \get_app();
$stamp1 = microtime(true);
$theme_file = file_get_contents("view/theme/$theme/theme.php");
- $a->getProfiler()->saveTimestamp($stamp1, "file");
+ $a->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
$result = preg_match("|/\*.*\*/|msU", $theme_file, $matches);
self::$errorno = $errorno;
}
- self::$profiler->saveTimestamp($stamp1, 'database');
+ self::$profiler->saveTimestamp($stamp1, 'database', System::callstack());
if (self::$configCache->get('system', 'db_log')) {
$stamp2 = microtime(true);
self::$errorno = $errorno;
}
- self::$profiler->saveTimestamp($stamp, "database_write");
+ self::$profiler->saveTimestamp($stamp, "database_write", System::callstack());
return $retval;
}
}
}
- self::$profiler->saveTimestamp($stamp1, 'database');
+ self::$profiler->saveTimestamp($stamp1, 'database', System::callstack());
return $columns;
}
break;
}
- self::$profiler->saveTimestamp($stamp1, 'database');
+ self::$profiler->saveTimestamp($stamp1, 'database', System::callstack());
return $ret;
}
$stamp1 = microtime(true);
file_put_contents($path, $string);
- $a->getProfiler()->saveTimestamp($stamp1, "file");
+ $a->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
}
/**
$a = \get_app();
$stamp1 = microtime(true);
file_put_contents($tempfile, $img_str);
- $a->getProfiler()->saveTimestamp($stamp1, "file");
+ $a->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
$data = getimagesize($tempfile);
unlink($tempfile);
$stamp1 = microtime(true);
$imagedata = @file_get_contents($url);
- $a->getProfiler()->saveTimestamp($stamp1, "file");
+ $a->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
}
$maximagesize = Config::get('system', 'maximagesize');
$stamp1 = microtime(true);
file_put_contents($tempfile, $imagedata);
- $a->getProfiler()->saveTimestamp($stamp1, "file");
+ $a->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
$data = getimagesize($tempfile);
@curl_close($ch);
- $a->getProfiler()->saveTimestamp($stamp1, 'network');
+ $a->getProfiler()->saveTimestamp($stamp1, 'network', System::callstack());
return $curlResponse;
}
curl_close($ch);
- $a->getProfiler()->saveTimestamp($stamp1, 'network');
+ $a->getProfiler()->saveTimestamp($stamp1, 'network', System::callstack());
Logger::log('post_url: end ' . $url, Logger::DATA);
$http_code = $curl_info['http_code'];
curl_close($ch);
- $a->getProfiler()->saveTimestamp($stamp1, "network");
+ $a->getProfiler()->saveTimestamp($stamp1, "network", System::callstack());
if ($http_code == 0) {
return $url;
$body = curl_exec($ch);
curl_close($ch);
- $a->getProfiler()->saveTimestamp($stamp1, "network");
+ $a->getProfiler()->saveTimestamp($stamp1, "network", System::callstack());
if (trim($body) == "") {
return $url;
namespace Friendica\Util;
-use Friendica\Core;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
*
* @param int $timestamp the Timestamp
* @param string $value A value to profile
+ * @param string $callstack The callstack of the current profiling data
*/
- public function saveTimestamp($timestamp, $value)
+ public function saveTimestamp($timestamp, $value, $callstack = '')
{
if (!$this->enabled) {
return;
$this->performance[$value] += (float) $duration;
$this->performance['marktime'] += (float) $duration;
- $callstack = Core\System::callstack();
-
if (!isset($this->callstack[$value][$callstack])) {
// Prevent ugly E_NOTICE
$this->callstack[$value][$callstack] = 0;