1
0
Fork 0

Dependency of callstack moved one layer up

This commit is contained in:
Philipp Holzer 2019-02-16 23:17:10 +01:00
commit 0a7861da65
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
12 changed files with 39 additions and 40 deletions

View file

@ -232,7 +232,7 @@ class Network
@curl_close($ch);
$a->getProfiler()->saveTimestamp($stamp1, 'network');
$a->getProfiler()->saveTimestamp($stamp1, 'network', System::callstack());
return $curlResponse;
}
@ -334,7 +334,7 @@ class Network
curl_close($ch);
$a->getProfiler()->saveTimestamp($stamp1, 'network');
$a->getProfiler()->saveTimestamp($stamp1, 'network', System::callstack());
Logger::log('post_url: end ' . $url, Logger::DATA);
@ -641,7 +641,7 @@ class Network
$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;
@ -683,7 +683,7 @@ class Network
$body = curl_exec($ch);
curl_close($ch);
$a->getProfiler()->saveTimestamp($stamp1, "network");
$a->getProfiler()->saveTimestamp($stamp1, "network", System::callstack());
if (trim($body) == "") {
return $url;

View file

@ -2,7 +2,6 @@
namespace Friendica\Util;
use Friendica\Core;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
@ -58,8 +57,9 @@ class Profiler implements ContainerInterface
*
* @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;
@ -75,8 +75,6 @@ class Profiler implements ContainerInterface
$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;