Fiber::Profiler
Detects fibers that are stalling the event loop.
Motivation
Migrating existing applications to the event loop can be tricky. One of the most common issues is when a fiber is blocking the event loop. This can happen when a fiber is waiting on a blocking operation, such as a database query, or a network request, that could not take advantage of the event loop. This can cause the event loop to stall, and prevent other fibers from running. This gem provides a way to detect these fibers, and help you identify the cause of the stall.
Usage
Please browse the reference index or refer to the guides below.
Getting Started
This guide explains how to install the fiber profiler and choose a mode for diagnosing event-loop stalls.
Watchdog Mode
This guide explains how to sample ongoing fiber stalls with the watchdog profiler.
Capture Mode
This guide explains how to trace fiber execution and analyze call timings with the capture profiler.
Releases
Please browse the releases for more details.
v0.7.0
- Sign releases with the Socketry Ruby Gems certificate.
v0.6.0
- Fixed compatibility with
Process.fork.
v0.1.3
- Improved performance when not profiling (when sampling is enabled).
v0.1.0
- Initial implementation extracted from
io-eventgem.
Contributing
We welcome contributions to this project.
- Fork the repository.
- Create your feature branch (
git checkout -b my-new-feature). - Commit your changes (
git commit -am 'Add some feature.'). - Push to the branch (
git push origin my-new-feature). - Create a new pull request.
Running Tests
To run the test suite:
$ bundle exec sus
Making Releases
To make a new release:
$ bundle exec bake gem:github:release:patch # or minor or major
See bake-gem-github for setup and release instructions.
Developer Certificate of Origin
In order to protect users of this project, we require all contributors to comply with the Developer Certificate of Origin. This ensures that all contributions are properly licensed and attributed.
Community Guidelines
This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.