File: worker.py

package info (click to toggle)
dask.distributed 2022.12.1%2Bds.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,164 kB
  • sloc: python: 81,938; javascript: 1,549; makefile: 228; sh: 100
file content (32 lines) | stat: -rw-r--r-- 840 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from __future__ import annotations

from tornado.ioloop import IOLoop

from distributed.dashboard.components.worker import (
    counters_doc,
    profile_doc,
    profile_server_doc,
    status_doc,
    systemmonitor_doc,
)
from distributed.dashboard.core import BokehApplication

template_variables = {"pages": ["status", "system", "profile", "profile-server"]}


def connect(application, http_server, worker, prefix=""):
    bokeh_app = BokehApplication(
        applications, worker, prefix=prefix, template_variables=template_variables
    )
    application.add_application(bokeh_app)
    bokeh_app.initialize(IOLoop.current())
    bokeh_app.start()


applications = {
    "/status": status_doc,
    "/counters": counters_doc,
    "/system": systemmonitor_doc,
    "/profile": profile_doc,
    "/profile-server": profile_server_doc,
}