Skip to content
Open
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
12 changes: 8 additions & 4 deletions python/ray/data/_internal/execution/streaming_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ def __init__(
# by comparing it with the current timestamp.
self._metrics_last_updated: float = 0.0

self._initialize_metrics_gauges()

Executor.__init__(self, self._data_context.execution_options)
thread_name = f"StreamingExecutor-{self._dataset_id}"
threading.Thread.__init__(self, daemon=True, name=thread_name)

def _initialize_metrics_gauges(self) -> None:
"""Initialize all Prometheus-style metrics gauges for monitoring execution."""
self._sched_loop_duration_s = Gauge(
"data_sched_loop_duration_s",
description="Duration of the scheduling loop in seconds",
Expand Down Expand Up @@ -149,10 +157,6 @@ def __init__(
tag_keys=("dataset", "operator"),
)

Executor.__init__(self, self._data_context.execution_options)
thread_name = f"StreamingExecutor-{self._dataset_id}"
threading.Thread.__init__(self, daemon=True, name=thread_name)

def execute(
self, dag: PhysicalOperator, initial_stats: Optional[DatasetStats] = None
) -> OutputIterator:
Expand Down