8000 Expose runtime settings & stats for metrics scraping and diagnostics by jeremy · Pull Request #335 · libvips/ruby-vips · GitHub
[go: up one dir, main page]

Skip to content

Expose runtime settings & stats for metrics scraping and diagnostics #335

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

Merged
merged 1 commit into from
May 24, 2022

Conversation

jeremy
Copy link
Contributor
@jeremy jeremy commented May 19, 2022

I frequently find myself attaching these via FFI for closer inspection, so I figured they may be worthwhile to have available by default.

Metrics for allocations and open files:

  • Vips.tracked_mem - bytes currently allocated
  • Vips.tracked_mem_highwater - max bytes allocated
  • Vips.tracked_allocs - current allocation count
  • Vips.tracked_files - current open file count

Expose global settings for inspection:

  • Vips.vector? - whether SIMD vector support is enabled
  • Vips.cache_max - max operations to cache
  • Vips.cache_max_mem - max bytes to cache
  • Vips.cache_max_files - max open files to cache

Updated the corresponding Ruby setter methods to return the new value rather than nil.

Metrics for allocations and open files:
* `Vips.tracked_mem` - bytes currently allocated
* `Vips.tracked_mem_highwater` - max bytes allocated
* `Vips.tracked_allocs` - current allocation count
* `Vips.tracked_files` - current open file count

Expose global settings for inspection:
* `Vips.vector?` - whether SIMD vector support is enabled
* `Vips.cache_max` - max operations to cache
* `Vips.cache_max_mem` - max bytes to cache
* `Vips.cache_max_files` - max open files to cache
@jeremy jeremy force-pushed the runtime-inspection branch from ea88e72 to a30fc5b Compare May 24, 2022 07:01
@jeremy
Copy link
Contributor Author
jeremy commented May 24, 2022

I was puzzled that setting concurrency to 0 didn't reset to default. I misread how that works, though. I think exposing the default concurrency and resetting to it is helpful, though, so split that into #336.

@jcupitt
Copy link
Member
jcupitt commented May 24, 2022

Thank you for doing this work, @jeremy. I'm fighting pyvips right now, but I should be on ruby-vips in another day or so and I'll review and merge these useful PRs then.

@jcupitt jcupitt merged commit c07ab5d into libvips:master May 24, 2022
jcupitt added a commit that referenced this pull request May 24, 2022
@jcupitt
Copy link
Member
jcupitt commented May 24, 2022

For once I finished off pyvips more easily than I expected heh.

This looks great. thanks again. I added a note to the changelog crediting you, I hope that's OK.

@jeremy
Copy link
Contributor Author
jeremy commented May 24, 2022

Nice @jcupitt - thank you!

@jeremy jeremy deleted the runtime-inspection branch May 24, 2022 22:34
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
0