Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add Event Loop Lag to Server::stats() #365

Open
Avariya opened this issue Sep 27, 2024 · 0 comments
Open

[Feature Request] Add Event Loop Lag to Server::stats() #365

Avariya opened this issue Sep 27, 2024 · 0 comments

Comments

@Avariya
Copy link

Avariya commented Sep 27, 2024

  1. What did you do? If possible, provide a simple script for reproducing the error.

written with GPT blessing. But sure it can be done in native way

        Timer::tick(1000, static function () use ($eventLoopLagProvider) {
            static $lastTime = 0;
            $currentTime = microtime(true);
            if ($lastTime > 0) {
                /** @var float $eventLoopLag */
                $eventLoopLag = ($currentTime - $lastTime - 1) * 1000;
                $eventLoopLagProvider->setEventLoopLag($eventLoopLag);
            }

            $lastTime = $currentTime;
        });



  1. What did you expect to see?

prometheus gauge static with actual event loop lag value in ms 


  1. What did you see instead?
 nothing

  1. What version of OpenSwoole are you using (show your php --ri openswoole)?
any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant