Skip to content

Commit

Permalink
feat(process): support malloc / oldmalloc increase bytes limit GC stat (
Browse files Browse the repository at this point in the history
  • Loading branch information
booleanbetrayal committed Jan 30, 2024
1 parent 239e2c6 commit f54709a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/prometheus_exporter/instrumentation/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def collect_gc_stats(metric)
metric[:major_gc_ops_total] = stat[:major_gc_count]
metric[:minor_gc_ops_total] = stat[:minor_gc_count]
metric[:allocated_objects_total] = stat[:total_allocated_objects]
metric[:malloc_increase_bytes_limit] = stat[:malloc_increase_bytes_limit]
metric[:oldmalloc_increase_bytes_limit] = stat[:oldmalloc_increase_bytes_limit]
end

def collect_v8_stats(metric)
Expand Down
2 changes: 2 additions & 0 deletions lib/prometheus_exporter/server/process_collector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class ProcessCollector < TypeCollector
v8_physical_size: "Physical size consumed by V8 heaps.",
v8_heap_count: "Number of V8 contexts running.",
rss: "Total RSS used by process.",
malloc_increase_bytes_limit: 'Limit before Ruby triggers a GC against current objects (bytes).',
oldmalloc_increase_bytes_limit: 'Limit before Ruby triggers a major GC against old objects (bytes).'
}

PROCESS_COUNTERS = {
Expand Down

0 comments on commit f54709a

Please sign in to comment.