1from tornado.ioloop import IOLoop
2
3from .components.worker import (
4    counters_doc,
5    crossfilter_doc,
6    profile_doc,
7    profile_server_doc,
8    status_doc,
9    systemmonitor_doc,
10)
11from .core import BokehApplication
12
13template_variables = {
14    "pages": ["status", "system", "profile", "crossfilter", "profile-server"]
15}
16
17
18def connect(application, http_server, worker, prefix=""):
19    bokeh_app = BokehApplication(
20        applications, worker, prefix=prefix, template_variables=template_variables
21    )
22    application.add_application(bokeh_app)
23    bokeh_app.initialize(IOLoop.current())
24
25
26applications = {
27    "/status": status_doc,
28    "/counters": counters_doc,
29    "/crossfilter": crossfilter_doc,
30    "/system": systemmonitor_doc,
31    "/profile": profile_doc,
32    "/profile-server": profile_server_doc,
33}
34