Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

RubyVM.stat

RubyVM.stat → Hash
RubyVM.stat(hsh) → hsh
RubyVM.stat(Symbol) → Numeric

Returns a Hash containing implementation-dependent counters inside the VM.

This hash includes information about method/constant caches:

Example
{
  :constant_cache_invalidations=>2,
  :constant_cache_misses=>14,
  :global_cvar_state=>27
}

If USE_DEBUG_COUNTER is enabled, debug counters will be included.

The contents of the hash are implementation specific and may be changed in the future.

This method is only expected to work on C Ruby.

See also .keep_script_lines= .keep_script_lines also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0