Skip to content

Commit 2c3e549

Browse files
Move the compaction warning below the table
Having it between the table header and the data makes the data table harder to read so we should put it somewhere less obtrusive
1 parent ef59d05 commit 2c3e549

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎harness-ractor/harness.rb‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def run_benchmark_gc(warmup_itrs, bench_itrs, block, ractor_args, gc_config:)
130130
end
131131
gc_by_ractors[rs] = group
132132
end
133+
print_gc_legend
133134

134135
return_results(warmups.values.flatten, stats.values.flatten, warmup_by_ractors: warmups, bench_by_ractors: stats, **ractor_gc_results(gc_by_ractors, gc_config))
135136
end
@@ -138,6 +139,9 @@ def print_gc_header(prefix)
138139
header = prefix + " gc_total marking sweeping gc_count major minor global"
139140
CONTROLLER_GC_SERIES.each_value { |(_stat_key, label)| header << " %9s" % label }
140141
puts header
142+
end
143+
144+
def print_gc_legend
141145
puts "(* controller-observed compacting cycles; may overlap global counts and is not additive.)" if CONTROLLER_GC_SERIES.any?
142146
end
143147

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

284+
print_gc_legend if RACTOR_GC_ENABLED
285+
280286
medians = counts.to_h { |count| [count, memory_summary(memory[count])] }
281287
print_memory_metrics(medians)
282288

‎test/ractor_gc_harness_test.rb‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,12 @@ def run_workload(body, env: {})
222222
assert_equal %w[0 1 2], data['gc_by_ractors'].keys.sort
223223

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

229233
expected_worker_keys = %w[

0 commit comments

Comments
 (0)