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

Keep gauges in sync with GC.stat #6

Merged
merged 1 commit into from
Nov 1, 2024
Merged

Conversation

jeremy
Copy link
Contributor

@jeremy jeremy commented Oct 31, 2024

Omit defunct stats and support new ones automatically.

Example on Ruby 3.4.0-preview2. Before:

>> GC.stat.keys - Yabeda.gc.methods(false)
=> [:heap_empty_pages, :heap_allocatable_slots]
>> Yabeda.gc.methods(false) - GC.stat.keys
=> [:heap_sorted_length, :heap_allocatable_pages, :heap_tomb_pages]

After:

>> GC.stat.keys - Yabeda.gc.methods(false)
=> []
>> Yabeda.gc.methods(false) - GC.stat.keys
=> []

Copy link
Collaborator

@Envek Envek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the pull request! I like the approach!

Can you please run rubocop -A and drop the check heap_allocatable_pages from the spec (seems that it has gone from Ruby 3.4)?

Seems that this pull request doesn't allow edit from maintainers, so I can't push fixes myself.

@jeremy
Copy link
Contributor Author

jeremy commented Oct 31, 2024

@Envek sure, done

@jeremy jeremy force-pushed the all-gc-stats branch 3 times, most recently from 73a1dd9 to e06677c Compare October 31, 2024 18:37
Omit defunct stats and support new ones automatically.

Stats without a verbose comment default to their own name since
the Prometheus exporter requires one.

Example on Ruby 3.4.0-preview2:
```ruby
>> GC.stat.keys - Yabeda.gc.methods(false)
=> [:heap_empty_pages, :heap_allocatable_slots]
>> Yabeda.gc.methods(false) - GC.stat.keys
=> [:heap_sorted_length, :heap_allocatable_pages, :heap_tomb_pages]
```
@Envek Envek merged commit b7f5fd7 into ianks:master Nov 1, 2024
5 of 6 checks passed
@Envek
Copy link
Collaborator

Envek commented Nov 1, 2024

Released in 0.4.0, thanks!

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

Successfully merging this pull request may close these issues.

2 participants