Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/Profiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,23 @@ public function getProfilerOutput($httpCode, $dbProfiler = 0, $responseElapsedTi
: [];
}

public function getTaskerProfilerOutput($executionTime = 0, $dbProfiler = 2)
{
return $this->hasProfilers() && $this->shouldLogProfiler(200, $executionTime)
? $this->getFormatted($dbProfiler, $executionTime)
: [];
}

public function getProfilerSummary()
{
return (new ProfilerSummary($this->profilers))->getSummary();
}

/**
* @param $httpCode int HTTP Response Code
* @param $responseElapsedTime int Response time in seconds
* @return bool
*/
private function shouldLogProfiler($httpCode, $responseElapsedTime)
{
if ($this->logLevel === self::LOG_OFF) {
Expand All @@ -94,7 +106,7 @@ private function shouldLogProfiler($httpCode, $responseElapsedTime)
return true;
}

if($this->isRequestTresholdExceded($responseElapsedTime)){
if ($this->isRequestTresholdExceded($responseElapsedTime)) {
return true;
}

Expand Down