-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #278 from JuliaParallel/jps/logging-overhaul
Logging overhaul and new web dashboard
- Loading branch information
Showing
25 changed files
with
1,940 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
environment: | ||
matrix: | ||
- julia_version: 1.3 | ||
- julia_version: 1.6 | ||
- julia_version: nightly | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Scheduler Visualization with DaggerWebDash | ||
|
||
When working with Dagger, especially when working with its scheduler, it can be | ||
helpful to visualize what Dagger is doing internally. To assist with this, a | ||
web dashboard is available in the DaggerWebDash.jl package. This web dashboard | ||
uses a web server running within each Dagger worker, along with event logging | ||
information, to expose details about the scheduler. Information like worker and | ||
processor saturation, memory allocations, profiling traces, and much more are | ||
available in easy-to-interpret plots. | ||
|
||
Using the dashboard is relatively simple and straightforward; if you run | ||
Dagger's benchmarking script, it's enabled for you automatically if the | ||
`BENCHMARK_RENDER` environment variable is set to `webdash`. This is the | ||
easiest way to get started with the web dashboard for new users. | ||
|
||
For manual usage, the following snippet of code will suffice: | ||
|
||
```julia | ||
ctx = Context() # or `ctx = Dagger.Sch.eager_context()` for eager API usage | ||
ml = Dagger.MultiEventLog() | ||
|
||
## Add some logging events of interest | ||
|
||
ml[:core] = Dagger.Events.CoreMetrics() | ||
ml[:id] = Dagger.Events.IDMetrics() | ||
ml[:timeline] = Dagger.Events.TimelineMetrics() | ||
# ... | ||
|
||
# (Optional) Enable profile flamegraph generation with ProfileSVG | ||
ml[:profile] = DaggerWebDash.ProfileMetrics() | ||
ctx.profile = true | ||
|
||
# Create a LogWindow; necessary for real-time event updates | ||
lw = Dagger.Events.LogWindow(20*10^9, :core) | ||
ml.aggregators[:logwindow] = lw | ||
|
||
# Create the D3Renderer server on port 8080 | ||
d3r = DaggerWebDash.D3Renderer(8080) | ||
|
||
## Add some plots! Rendered top-down in order | ||
|
||
# Show an overview of all generated events as a Gantt chart | ||
push!(d3r, GanttPlot(:core, :id, :timeline, :esat, :psat, "Overview")) | ||
|
||
# Show various numerical events as line plots over time | ||
push!(d3r, LinePlot(:core, :wsat, "Worker Saturation", "Running Tasks")) | ||
push!(d3r, LinePlot(:core, :loadavg, "CPU Load Average", "Average Running Threads")) | ||
push!(d3r, LinePlot(:core, :bytes, "Allocated Bytes", "Bytes")) | ||
push!(d3r, LinePlot(:core, :mem, "Available Memory", "% Free")) | ||
|
||
# Show a graph rendering of compute tasks and data movement between them | ||
# Note: Profile events are ignored if absent from the log | ||
push!(d3r, GraphPlot(:core, :id, :timeline, :profile, "DAG")) | ||
|
||
# TODO: Not yet functional | ||
#push!(d3r, ProfileViewer(:core, :profile, "Profile Viewer")) | ||
|
||
# Add the D3Renderer as a consumer of special events generated by LogWindow | ||
push!(lw.creation_handlers, d3r) | ||
push!(lw.deletion_handlers, d3r) | ||
|
||
# D3Renderer is also an aggregator | ||
ml.aggregators[:d3r] = d3r | ||
|
||
ctx.log_sink = ml | ||
# ... use `ctx` | ||
``` | ||
|
||
Once the server has started, you can browse to `http://localhost:8080/` (if | ||
running on your local machine) to view the plots in real time. The dashboard | ||
also provides options at the top of the page to control the drawing speed, | ||
enable and disable reading updates from the server (disabling freezes the | ||
display at the current instant), and a selector for which worker to look at. If | ||
the connection to the server is lost for any reason, the dashboard will attempt | ||
to reconnect at 5 second intervals. The dashboard can usually survive restarts | ||
of the server perfectly well, although refreshing the page is usually a good | ||
idea. Informational messages are also logged to the browser console for | ||
debugging. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name = "DaggerWebDash" | ||
uuid = "cfc5aa84-1a2a-41ab-b391-ede92ecae40c" | ||
authors = ["Julian P Samaroo <[email protected]>"] | ||
version = "0.1.0" | ||
|
||
[deps] | ||
Dagger = "d58978e5-989f-55fb-8d15-ea34adc7bf54" | ||
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" | ||
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" | ||
MemPool = "f9f48841-c794-520a-933b-121f7ba6ed94" | ||
Mux = "a975b10e-0019-58db-a62f-e48ff68538c9" | ||
ProfileSVG = "132c30aa-f267-4189-9183-c8a63c7e05e6" | ||
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" | ||
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" | ||
|
||
[compat] | ||
Dagger = "0.13.2" | ||
JSON3 = "1" | ||
MemPool = "0.3" | ||
Mux = "0.7" | ||
ProfileSVG = "0.2" | ||
StructTypes = "1" | ||
julia = "1.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module DaggerWebDash | ||
|
||
using Dagger | ||
|
||
include("core.jl") | ||
include("profile.jl") | ||
include("d3.jl") | ||
|
||
end |
Oops, something went wrong.
f897e6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register()
f897e6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/44717
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
f897e6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register subdir=lib/DaggerWebDash
f897e6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/44727
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: