You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extracted GVL/memory instrumentation from our applications into the shared gem.
Added new files (loaded only via explicit require):
patches/active_support_event — adds #gvl_time and #malloc_increase_bytes to ActiveSupport::Notifications::Event;
patches/rails_semantic_logger — enriches the "Completed" action log entry with GC/GVL/allocation stats;
semantic_logger/sidekiq_job_metrics — same stats for Sidekiq jobs.
TinyJsonFormatter now supports optional duration and payload keys in custom_names_mapping. Previously such keys were silently ignored. Output is unchanged unless the keys are explicitly requested.
Nice that the patches are opt-in (require-your-own) and covered by specs. Two small notes:
GC.stat[:malloc_increase_bytes] allocates the whole stat hash. In lib/umbrellio_utils/patches/active_support_event.rb, start!/finish! call GC.stat[:malloc_increase_bytes], which builds the entire GC.stat hash (~30 entries) each time — twice per instrumented event. GC.stat(:malloc_increase_bytes) reads just that one key without allocating the hash. A little ironic for allocation instrumentation, and cheap to change.
malloc_increase_bytes can be negative / cross-thread. It's a delta of a process-global GC counter, so it (a) can drop below zero if a GC runs inside the window, and (b) under threaded servers (Puma threads, Sidekiq concurrency) includes allocations from sibling threads. The consuming yabeda PRs guard with .positive?, but Event#malloc_increase_bytes surfacing negatives might deserve a doc caveat. gvl_time (GVLTools LocalTimer) is per-thread, so that one is fine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracted GVL/memory instrumentation from our applications into the shared gem.
Added new files (loaded only via explicit
require):patches/active_support_event— adds#gvl_timeand#malloc_increase_bytestoActiveSupport::Notifications::Event;patches/rails_semantic_logger— enriches the "Completed" action log entry with GC/GVL/allocation stats;semantic_logger/sidekiq_job_metrics— same stats for Sidekiq jobs.TinyJsonFormatternow supports optionaldurationandpayloadkeys incustom_names_mapping. Previously such keys were silently ignored. Output is unchanged unless the keys are explicitly requested.