Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def status_doc(worker, extra, doc):
with log_errors():
statetable = StateTable(worker)
executing_ts = ExecutingTimeSeries(worker, sizing_mode="scale_width")
communicating_ts = CommunicatingTimeSeries(worker, sizing_mode="scale_width")
communicating_stream = CommunicatingStream(worker, sizing_mode="scale_width")
xr = executing_ts.root.x_range
communicating_ts.root.x_range = xr
communicating_stream.root.x_range = xr
doc.title = "Dask Worker Internal Monitor"
add_periodic_callback(doc, statetable, 200)
add_periodic_callback(doc, executing_ts, 200)
add_periodic_callback(doc, communicating_ts, 200)
add_periodic_callback(doc, communicating_stream, 200)
doc.add_root(
column(
statetable.root,
executing_ts.root,
communicating_ts.root,
communicating_stream.root,
sizing_mode="scale_width",
)
)
doc.template = env.get_template("simple.html")
doc.template_variables["active_page"] = "status"
doc.template_variables.update(extra)
doc.theme = BOKEH_THEME
def stealing_doc(scheduler, extra, doc):
with log_errors():
occupancy = Occupancy(scheduler, height=200, sizing_mode="scale_width")
stealing_ts = StealingTimeSeries(scheduler, sizing_mode="scale_width")
stealing_events = StealingEvents(scheduler, sizing_mode="scale_width")
stealing_events.root.x_range = stealing_ts.root.x_range
doc.title = "Dask: Work Stealing"
add_periodic_callback(doc, occupancy, 500)
add_periodic_callback(doc, stealing_ts, 500)
add_periodic_callback(doc, stealing_events, 500)
doc.add_root(
column(
occupancy.root,
stealing_ts.root,
stealing_events.root,
sizing_mode="scale_width",
)
)
doc.template = env.get_template("simple.html")
doc.template_variables.update(extra)
doc.theme = BOKEH_THEME
def counters_doc(server, extra, doc):
with log_errors():
doc.title = "Dask Worker Counters"
counter = Counters(server, sizing_mode="stretch_both")
add_periodic_callback(doc, counter, 500)
doc.add_root(counter.root)
doc.template = env.get_template("simple.html")
doc.template_variables["active_page"] = "counters"
doc.template_variables.update(extra)
doc.theme = BOKEH_THEME
def individual_cpu_doc(scheduler, extra, doc):
current_load = CurrentLoad(scheduler, sizing_mode="stretch_both")
current_load.update()
add_periodic_callback(doc, current_load, 100)
doc.add_root(current_load.cpu_figure)
doc.theme = BOKEH_THEME
def gpu_memory_doc(scheduler, extra, doc):
gpu_load = GPUCurrentLoad(scheduler, sizing_mode="stretch_both")
gpu_load.update()
add_periodic_callback(doc, gpu_load, 100)
doc.add_root(gpu_load.memory_figure)
doc.theme = BOKEH_THEME
def individual_compute_time_per_key_doc(scheduler, extra, doc):
with log_errors():
component = ComputePerKey(scheduler, sizing_mode="stretch_both")
component.update()
add_periodic_callback(doc, component, 500)
doc.add_root(component.tabs)
doc.theme = BOKEH_THEME
task_progress.update()
add_periodic_callback(doc, task_progress, 100)
if len(scheduler.workers) < 50:
current_load = CurrentLoad(scheduler, sizing_mode="stretch_both")
current_load.update()
add_periodic_callback(doc, current_load, 100)
doc.add_root(current_load.nbytes_figure)
doc.add_root(current_load.processing_figure)
else:
nbytes_hist = NBytesHistogram(scheduler, sizing_mode="stretch_both")
nbytes_hist.update()
processing_hist = ProcessingHistogram(scheduler, sizing_mode="stretch_both")
processing_hist.update()
add_periodic_callback(doc, nbytes_hist, 100)
add_periodic_callback(doc, processing_hist, 100)
current_load_fig = row(
nbytes_hist.root, processing_hist.root, sizing_mode="stretch_both"
)
doc.add_root(nbytes_hist.root)
doc.add_root(processing_hist.root)
doc.title = "Dask: Status"
doc.add_root(task_progress.root)
doc.add_root(task_stream.root)
doc.theme = BOKEH_THEME
doc.template = env.get_template("status.html")
doc.template_variables.update(extra)
doc.theme = BOKEH_THEME
def status_doc(worker, extra, doc):
with log_errors():
statetable = StateTable(worker)
executing_ts = ExecutingTimeSeries(worker, sizing_mode="scale_width")
communicating_ts = CommunicatingTimeSeries(worker, sizing_mode="scale_width")
communicating_stream = CommunicatingStream(worker, sizing_mode="scale_width")
xr = executing_ts.root.x_range
communicating_ts.root.x_range = xr
communicating_stream.root.x_range = xr
doc.title = "Dask Worker Internal Monitor"
add_periodic_callback(doc, statetable, 200)
add_periodic_callback(doc, executing_ts, 200)
add_periodic_callback(doc, communicating_ts, 200)
add_periodic_callback(doc, communicating_stream, 200)
doc.add_root(
column(
statetable.root,
executing_ts.root,
communicating_ts.root,
communicating_stream.root,
sizing_mode="scale_width",
)
)
doc.template = env.get_template("simple.html")
doc.template_variables["active_page"] = "status"
doc.template_variables.update(extra)
doc.theme = BOKEH_THEME
def individual_progress_doc(scheduler, extra, doc):
task_progress = TaskProgress(scheduler, height=160, sizing_mode="stretch_both")
task_progress.update()
add_periodic_callback(doc, task_progress, 100)
doc.add_root(task_progress.root)
doc.theme = BOKEH_THEME
task_progress = TaskProgress(scheduler, sizing_mode="stretch_both")
task_progress.update()
add_periodic_callback(doc, task_progress, 100)
if len(scheduler.workers) < 50:
current_load = CurrentLoad(scheduler, sizing_mode="stretch_both")
current_load.update()
add_periodic_callback(doc, current_load, 100)
doc.add_root(current_load.nbytes_figure)
doc.add_root(current_load.processing_figure)
else:
nbytes_hist = NBytesHistogram(scheduler, sizing_mode="stretch_both")
nbytes_hist.update()
processing_hist = ProcessingHistogram(scheduler, sizing_mode="stretch_both")
processing_hist.update()
add_periodic_callback(doc, nbytes_hist, 100)
add_periodic_callback(doc, processing_hist, 100)
current_load_fig = row(
nbytes_hist.root, processing_hist.root, sizing_mode="stretch_both"
)
doc.add_root(nbytes_hist.root)
doc.add_root(processing_hist.root)
doc.title = "Dask: Status"
doc.add_root(task_progress.root)
doc.add_root(task_stream.root)
doc.theme = BOKEH_THEME
doc.template = env.get_template("status.html")
doc.template_variables.update(extra)
doc.theme = BOKEH_THEME