Skip to content

Commit 738ea29

Browse files
committed
DaggerWebDash: UI and functionality improvements
DaggerWebDash: Generalize for non-Dagger users ProcessorSaturation: Move from TimespanLogging to Dagger ProcessorSaturation: Avoid bad JSON serialization DaggerWebDash.GanttPlot: Remove timeline key DaggerWebDash: Add custom x-label, block coloring, and line disable opts DaggerWebDash: Show tooltip on hover
1 parent b953efb commit 738ea29

File tree

10 files changed

+172
-134
lines changed

10 files changed

+172
-134
lines changed

Diff for: benchmarks/benchmark.jl

+9-9
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,15 @@ function main()
160160
end
161161
elseif render == "webdash" || savelogs
162162
ml = TimespanLogging.MultiEventLog()
163-
ml[:core] = TimespanLogging.CoreMetrics()
164-
ml[:id] = TimespanLogging.IDMetrics()
165-
# FIXME: ml[:timeline] = TimespanLogging.TimelineMetrics()
166-
profile && (ml[:profile] = TimespanLoggingWebDash.ProfileMetrics())
167-
ml[:wsat] = TimespanLogging.WorkerSaturation()
168-
ml[:loadavg] = TimespanLogging.CPULoadAverages()
163+
ml[:core] = TimespanLogging.Events.CoreMetrics()
164+
ml[:id] = TimespanLogging.Events.IDMetrics()
165+
# FIXME: ml[:timeline] = TimespanLogging.Events.TimelineMetrics()
166+
profile && (ml[:profile] = DaggerWebDash.ProfileMetrics())
167+
ml[:wsat] = Dagger.Events.WorkerSaturation()
168+
ml[:loadavg] = TimespanLogging.Events.CPULoadAverages()
169169
ml[:bytes] = Dagger.Events.BytesAllocd()
170-
ml[:mem] = TimespanLogging.MemoryFree()
171-
ml[:esat] = TimespanLogging.EventSaturation()
170+
ml[:mem] = TimespanLogging.Events.MemoryFree()
171+
ml[:esat] = TimespanLogging.Events.EventSaturation()
172172
ml[:psat] = Dagger.Events.ProcessorSaturation()
173173
lw = TimespanLogging.Events.LogWindow(5*10^9, :core)
174174
logs_df = DataFrame([key=>[] for key in keys(ml.consumers)]...)
@@ -178,7 +178,7 @@ function main()
178178
d3r = DaggerWebDash.D3Renderer(live_port; seek_store=ts)
179179
push!(lw.creation_handlers, d3r)
180180
push!(lw.deletion_handlers, d3r)
181-
push!(d3r, GanttPlot(:core, :id, :timeline, :esat, :psat, "Overview"))
181+
push!(d3r, GanttPlot(:core, :id, :esat, :psat; title="Overview"))
182182
# TODO: push!(d3r, ProfileViewer(:core, :profile, "Profile Viewer"))
183183
push!(d3r, LinePlot(:core, :wsat, "Worker Saturation", "Running Tasks"))
184184
push!(d3r, LinePlot(:core, :loadavg, "CPU Load Average", "Average Running Threads"))

Diff for: docs/src/logging.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ TimespanLogging.Events.FullMetrics
7777
TimespanLogging.Events.CPULoadAverages
7878
TimespanLogging.Events.MemoryFree
7979
TimespanLogging.Events.EventSaturation
80-
TimespanLogging.Events.WorkerSaturation
8180
Dagger.Events.BytesAllocd
8281
Dagger.Events.ProcessorSaturation
82+
Dagger.Events.WorkerSaturation
8383
```
8484

8585
The `MultiEventLog` also has a mechanism to call a set of functions, called

Diff for: docs/src/scheduler-visualization.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ d3r = DaggerWebDash.D3Renderer(8080)
4040
## Add some plots! Rendered top-down in order
4141

4242
# Show an overview of all generated events as a Gantt chart
43-
push!(d3r, GanttPlot(:core, :id, :timeline, :esat, :psat, "Overview"))
43+
push!(d3r, GanttPlot(:core, :id, :esat, :psat; title="Overview"))
4444

4545
# Show various numerical events as line plots over time
4646
push!(d3r, LinePlot(:core, :wsat, "Worker Saturation", "Running Tasks"))

Diff for: lib/DaggerWebDash/src/core.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ using StructTypes, JSON3
33
sanitize(t::Tuple) = map(sanitize, t)
44
sanitize(t::NamedTuple) = map(sanitize, t)
55
sanitize(x::Function) = repr(x)
6-
sanitize(d::Dict) = Dict([sanitize(k)=>sanitize(d[k]) for k in keys(d)])
6+
sanitize(d::Dict) = Dict(sanitize(k)=>sanitize(d[k]) for k in keys(d))
77
sanitize(a::Array) = sanitize.(a)
8+
sanitize(s::Set) = Set(sanitize.(s))
89
sanitize(x) = x
910

1011
StructTypes.StructType(::Type{<:Dagger.Processor}) = StructTypes.CustomStruct()

Diff for: lib/DaggerWebDash/src/d3.jl

+8-2
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,22 @@ end
99
StructTypes.StructType(::Type{LinePlot}) = StructTypes.CustomStruct()
1010
StructTypes.lower(lp::LinePlot) = "linePlot(svg_container, \"$(lp.core_key)\", \"$(lp.data_key)\", \"$(lp.xlabel)\", \"$(lp.ylabel)\")"
1111

12+
const GanttPlotFieldSpec = Tuple{Union{Symbol,Nothing},Symbol,Float64,Bool}
1213
struct GanttPlot
1314
core_key::Symbol
1415
id_key::Symbol
15-
timeline_key::Symbol
1616
esat_key::Symbol
1717
psat_key::Symbol
1818
title::String
19+
x_label::String
20+
x_key::Union{Symbol,Nothing}
21+
to_color::Vector{GanttPlotFieldSpec}
1922
end
23+
GanttPlot(core_key, id_key, esat_key, psat_key; title="Overview", x_label="Time", x_key=nothing, to_color=GanttPlotFieldSpec[]) =
24+
GanttPlot(core_key, id_key, esat_key, psat_key,
25+
title, x_label, x_key, to_color)
2026
StructTypes.StructType(::Type{GanttPlot}) = StructTypes.CustomStruct()
21-
StructTypes.lower(lp::GanttPlot) = "ganttPlot(svg_container, \"$(lp.core_key)\", \"$(lp.id_key)\", \"$(lp.timeline_key)\", \"$(lp.esat_key)\", \"$(lp.psat_key)\", \"$(lp.title)\")"
27+
StructTypes.lower(lp::GanttPlot) = "ganttPlot(svg_container, \"$(lp.core_key)\", \"$(lp.id_key)\", \"$(lp.esat_key)\", \"$(lp.psat_key)\", \"$(lp.title)\", \"$(lp.x_label)\", \"$(lp.x_key)\", $(JSON3.write(sanitize(lp.to_color))))"
2228

2329
struct GraphPlot
2430
core_key::Symbol

0 commit comments

Comments
 (0)