gofiber / fiber

⚑️ Express inspired web framework written in Go

Home Page:https://gofiber.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› [Bug]: Middleware Monitor "CPU Usage" is a "static value".

nyufeng opened this issue Β· comments

commented

Bug Description

When I use "Monitor", I found that the value of "CPU Usage" of the program does not change, but the CPU usage of the program has been changing dynamically by top or htop. The system "CPU" is also changing dynamically.
After reading the source code, I found that this value is the average value since the program started, and does not reflect the current load of the program in real time. I hope to improve it.

How to Reproduce

monitor.New()

Expected Behavior

Dynamically changing like top.

Fiber Version

v2.52.4

Code Snippet (optional)

No response

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

Thanks for opening your first issue here! πŸŽ‰ Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

commented

If you're wondering the same thing, here's how to fix it
https://github.com/nyufeng/fiber-monitor