Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions harness-ractor/harness.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def run_benchmark_gc(warmup_itrs, bench_itrs, block, ractor_args, gc_config:)
end
gc_by_ractors[rs] = group
end
print_gc_legend

return_results(warmups.values.flatten, stats.values.flatten, warmup_by_ractors: warmups, bench_by_ractors: stats, **ractor_gc_results(gc_by_ractors, gc_config))
end
Expand All @@ -138,6 +139,9 @@ def print_gc_header(prefix)
header = prefix + " gc_total marking sweeping gc_count major minor global"
CONTROLLER_GC_SERIES.each_value { |(_stat_key, label)| header << " %9s" % label }
puts header
end

def print_gc_legend
puts "(* controller-observed compacting cycles; may overlap global counts and is not additive.)" if CONTROLLER_GC_SERIES.any?
end

Expand Down Expand Up @@ -277,6 +281,8 @@ def run_scenario_benchmark(bench_itrs, gc_config:, &scenario)
gc_by_ractors[count] = group.merge(series)
end

print_gc_legend if RACTOR_GC_ENABLED

medians = counts.to_h { |count| [count, memory_summary(memory[count])] }
print_memory_metrics(medians)

Expand Down
8 changes: 6 additions & 2 deletions test/ractor_gc_harness_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,12 @@ def run_workload(body, env: {})
assert_equal %w[0 1 2], data['gc_by_ractors'].keys.sort

if data['gc_by_ractors'].values.any? { |group| group.key?('gc_controller_compact_count_bench') }
assert_includes stdout, '(* controller-observed compacting cycles; may overlap global counts and is not additive.)',
'a starred stdout column must always come with the exact legend line'
legend = '(* controller-observed compacting cycles; may overlap global counts and is not additive.)'
lines = stdout.lines(chomp: true)
legend_index = lines.index(legend)
refute_nil legend_index, 'a starred stdout column must always come with the exact legend line'
last_row_index = lines.rindex { |line| line.match?(/\A2\s+#2:/) }
assert_operator legend_index, :>, last_row_index, 'the legend must follow the last table row'
end

expected_worker_keys = %w[
Expand Down
Loading