gh-141645: Refactor tachyon's live TUI tests to not use private fields (#141806)

This commit is contained in:
Pablo Galindo Salgado 2025-11-21 00:35:37 +00:00 committed by GitHub
parent 77cb39e0c7
commit 07410da204
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 142 additions and 142 deletions

View file

@ -180,7 +180,7 @@ def draw_header_info(self, line, width, elapsed):
# Calculate display refresh rate
refresh_hz = (
1.0 / self.collector._display_update_interval if self.collector._display_update_interval > 0 else 0
1.0 / self.collector.display_update_interval if self.collector.display_update_interval > 0 else 0
)
# Get current view mode and thread display
@ -248,8 +248,8 @@ def draw_sample_stats(self, line, width, elapsed):
)
# Update max sample rate
if sample_rate > self.collector._max_sample_rate:
self.collector._max_sample_rate = sample_rate
if sample_rate > self.collector.max_sample_rate:
self.collector.max_sample_rate = sample_rate
col = 0
self.add_str(line, col, "Samples: ", curses.A_BOLD)
@ -308,11 +308,11 @@ def draw_sample_stats(self, line, width, elapsed):
def draw_efficiency_bar(self, line, width):
"""Draw sample efficiency bar showing success/failure rates."""
success_pct = (
self.collector._successful_samples
self.collector.successful_samples
/ max(1, self.collector.total_samples)
) * 100
failed_pct = (
self.collector._failed_samples
self.collector.failed_samples
/ max(1, self.collector.total_samples)
) * 100
@ -327,7 +327,7 @@ def draw_efficiency_bar(self, line, width):
bar_width = min(MAX_EFFICIENCY_BAR_WIDTH, available_width)
success_fill = int(
(
self.collector._successful_samples
self.collector.successful_samples
/ max(1, self.collector.total_samples)
)
* bar_width
@ -381,7 +381,7 @@ def draw_thread_status(self, line, width):
"""Draw thread status statistics and GC information."""
# Get status counts for current view mode
thread_data = self.collector._get_current_thread_data()
status_counts = thread_data.as_status_dict() if thread_data else self.collector._thread_status_counts
status_counts = thread_data.as_status_dict() if thread_data else self.collector.thread_status_counts
# Calculate percentages
total_threads = max(1, status_counts["total"])
@ -395,7 +395,7 @@ def draw_thread_status(self, line, width):
pct_gc = (thread_data.gc_frame_samples / total_samples) * 100
else:
total_samples = max(1, self.collector.total_samples)
pct_gc = (self.collector._gc_frame_samples / total_samples) * 100
pct_gc = (self.collector.gc_frame_samples / total_samples) * 100
col = 0
self.add_str(line, col, "Threads: ", curses.A_BOLD)
@ -809,7 +809,7 @@ def get_trend_color(column_name):
# File:line column
if col < width - 10:
simplified_path = self.collector._simplify_path(filename)
simplified_path = self.collector.simplify_path(filename)
file_line = f"{simplified_path}:{lineno}"
remaining_width = width - col - 1
self.add_str(