%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : addictionfreeind ( 1003)
PHP Version : 7.2.34
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/addictionfreeind/www/admin1/vendor/sentry/sentry/src/Profiling/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/addictionfreeind/www/admin1/vendor/sentry/sentry/src/Profiling/Profiler.php
<?php

declare(strict_types=1);

namespace Sentry\Profiling;

use Sentry\Options;

/**
 * @internal
 */
final class Profiler
{
    /**
     * @var \ExcimerProfiler|null
     */
    private $profiler;

    /**
     * @var Profile
     */
    private $profile;

    /**
     * @var float The sample rate (10.01ms/101 Hz)
     */
    private const SAMPLE_RATE = 0.0101;

    /**
     * @var int The maximum stack depth
     */
    private const MAX_STACK_DEPTH = 128;

    public function __construct(?Options $options = null)
    {
        $this->profile = new Profile($options);

        $this->initProfiler();
    }

    public function start(): void
    {
        if (null !== $this->profiler) {
            $this->profiler->start();
        }
    }

    public function stop(): void
    {
        if (null !== $this->profiler) {
            $this->profiler->stop();

            $this->profile->setExcimerLog($this->profiler->flush());
        }
    }

    public function getProfile(): ?Profile
    {
        if (null === $this->profiler) {
            return null;
        }

        return $this->profile;
    }

    private function initProfiler(): void
    {
        if (\extension_loaded('excimer') && \PHP_VERSION_ID >= 70300) {
            $this->profiler = new \ExcimerProfiler();
            $this->profile->setStartTimeStamp(microtime(true));

            $this->profiler->setEventType(EXCIMER_REAL);
            $this->profiler->setPeriod(self::SAMPLE_RATE);
            $this->profiler->setMaxDepth(self::MAX_STACK_DEPTH);
        }
    }
}

VaKeR 2022