Skip to content

Commit

Permalink
Dashboard: Fix Fine Perf. Metrics w/ bokeh 3
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger committed Jun 1, 2023
1 parent 3633d4c commit 28b2d31
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions distributed/dashboard/components/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3411,7 +3411,6 @@ def handle_selector_chng(attr, old, new):
self.root = column(
self.function_selector,
self.unit_selector,
row([figure(), figure(), figure()], sizing_mode="stretch_width"),
sizing_mode="scale_width",
)

Expand Down Expand Up @@ -3497,23 +3496,29 @@ def update(self):
f"Filter by function ({len(self.function_selector.options)}):"
)

needs_figures_row = self.task_exec_by_activity_chart is None
self._build_task_execution_by_activity_chart(self.task_exec_data_limited.copy())
self._build_task_execution_by_prefix_chart(self.task_exec_data_limited.copy())
self._build_senddata_chart(self.senddata.copy())

# Replacing the child causes small blips if done every iteration vs updating
# renderers, but it's needed when new functions and/or activities show up to
# rerender plot
if not getattr(self, "__set", False):
self.root.children[-1].children[0] = self.task_exec_by_prefix_chart
self.root.children[-1].children[1] = self.task_exec_by_activity_chart
self.root.children[-1].children[2] = self.senddata_by_activity_chart
if self.substantial_change or needs_figures_row:
self.substantial_change = False
self.__set = True
# else:
# self.task_exec_by_prefix_chart.renderers = task_exec_piechart.renderers
# self.task_exec_by_activity_chart.renderers = task_exec_barchart.renderers
# self.senddata_by_activity_chart.renderers = senddata_piechart.renderers

figures_row = row(
children=[
self.task_exec_by_prefix_chart,
self.task_exec_by_activity_chart,
self.senddata_by_activity_chart,
],
sizing_mode="stretch_width",
)

if needs_figures_row:
# First iteration, initial assignment of figures row
self.root.children.append(figures_row)
else:
# Otherwise needs forced refresh by replacing the figures row
self.root.children[-1] = figures_row

Check warning on line 3521 in distributed/dashboard/components/scheduler.py

View check run for this annotation

Codecov / codecov/patch

distributed/dashboard/components/scheduler.py#L3521

Added line #L3521 was not covered by tests

def _build_task_execution_by_activity_chart(
self, task_exec_data: defaultdict[str, list]
Expand Down

0 comments on commit 28b2d31

Please sign in to comment.