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

Add YJIT metrics to Process #331

Open
erickguan opened this issue Jan 20, 2025 · 0 comments
Open

Add YJIT metrics to Process #331

erickguan opened this issue Jan 20, 2025 · 0 comments

Comments

@erickguan
Copy link

Hey!

I want to add a few metrics about YJIT in the Process instrumentation to understand the YJIT performance.

These metrics depend on the RUBYOPT=--yjit-stats flag and Ruby::YJIT.runtime_stats API.
When the Ruby process starts with --yjit-stats or RUBYOPT=--yjit-stats, the Ruby::YJIT.runtime_stats produces performance stats. Otherwise, Ruby::YJIT.runtime_stats returns nil. Naturally, I would propose to add:

  1. A new function collect_yjit_metrics in the Process#collect.
  2. collect_yjit_metrics collects:
    • ratio_in_yjit: the percentage of total YARV instructions executed by YJIT as opposed to the CRuby interpreter
    • code_region_size
    • yjit_alloc_size
    • code_gc_count
    • compiled_iseq_count
    • yjit_insns_count
    • side_exit_count
    • total_exit_count
    • avg_len_in_yjit

Reference: Ruby YJIT Docuementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant