Skip to content

Commit 58f0525

Browse files
update metrics
1 parent 43d5a1b commit 58f0525

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

docs/en/agent/meter-log-reporter.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ The agent automatically collects Ruby runtime metrics when `meter_reporter_activ
2525
- `instance_ruby_gc_time_total` - Total GC time in milliseconds (cumulative)
2626
- `instance_ruby_heap_usage_percent` - Heap memory usage percentage
2727
- `instance_ruby_heap_live_slots_count` - Number of live heap slots
28-
29-
**Object System Metrics:**
30-
31-
- `instance_ruby_total_allocated_objects` - Total allocated objects count
28+
- `instance_ruby_heap_available_slots_count` - Number of available heap slots
3229

3330
**Thread Metrics:**
3431

lib/skywalking/meter/runtime/ruby_runtime_data_source.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ def initialize
2626
@cache_duration = 60
2727
end
2828

29-
# Total allocated objects
30-
def total_allocated_objects_generator
29+
# Heap live slots count - important for memory pressure
30+
def heap_live_slots_count_generator
3131
stats = get_gc_stats
32-
stats[:total_allocated_objects] || 0
32+
stats[:heap_live_slots] || 0
3333
rescue
3434
0
3535
end
3636

37-
# Heap live slots count - important for memory pressure
38-
def heap_live_slots_count_generator
37+
# Heap available slots count - total capacity
38+
def heap_available_slots_count_generator
3939
stats = get_gc_stats
40-
stats[:heap_live_slots] || 0
40+
stats[:heap_available_slots] || 0
4141
rescue
4242
0
4343
end

0 commit comments

Comments
 (0)