Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion Stopwatch/Stopwatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ private function flushIfTimersLimitReached(): void
{
$timersCount = count(pinba_timers_get(PINBA_ONLY_STOPPED_TIMERS));
if ($timersCount >= self::FLUSH_TIMERS_LIMIT) {
pinba_flush(null, PINBA_FLUSH_ONLY_STOPPED_TIMERS);
pinba_flush($this->getScriptName(), PINBA_FLUSH_ONLY_STOPPED_TIMERS);
}
}

private function getScriptName(): string
{
$pinbaInfo = pinba_get_info();

return $pinbaInfo['script_name'] ?? '';
}
}
2 changes: 1 addition & 1 deletion meta/phpstan/stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function pinba_timers_get(int $flag = 0): array
}

if (!function_exists('pinba_flush')) {
function pinba_flush(?string $scriptName = null, int $flags = 0): void
function pinba_flush(string $scriptName = '', int $flags = 0): void
{
}
}
Expand Down