[ruby-core:113770] [Ruby master Feature#19056] Introduce `Fiber.annotation` for attaching messages to fibers.
From:
"ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>
Date:
2023-06-05 09:43:10 UTC
List:
ruby-core #113770
Issue #19056 has been updated by ioquatix (Samuel Williams).
I understand your concerns.
Every production system I've worked on has some kind of APM, and I've never heard anyone complain about the overhead - it's usually minuscule in comparison to the actual work being done.
I'm fine for it to be a gem, but it will limit the application to core libraries. Careful application of such a feature can be incredibly helpful for debugging.
One way to mitigate the performance is to use things like `prepend` to inject annotations to existing code. But it's clunky at best.
----------------------------------------
Feature #19056: Introduce `Fiber.annotation` for attaching messages to fibers.
https://bugs.ruby-lang.org/issues/19056#change-103420
* Author: ioquatix (Samuel Williams)
* Status: Open
* Priority: Normal
* Assignee: ioquatix (Samuel Williams)
----------------------------------------
It's useful to know what a fiber is doing especially when they have a temporal execution (i.e. sockets connecting vs connected, binding vs accepting, queue popping, etc)
Let's introduce `Fiber.annotate` and `Fiber#annotation` for logging a short message attached to Fibers.
```ruby
Fiber.annotate "Counting to 10"
10.times{|I| puts I}
# Fiber.current.annotation => "Counting to 10"
```
Pull Request: https://github.com/ruby/ruby/pull/6554
---Files--------------------------------
clipboard-202210160132-n7lzp.png (865 KB)
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/