You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds logging [INFO] to TimelineVisualizationCallback and HistoryCallback (#548)
* added info level logging to HistoryCallback to share directory
* add logging to timeline & update mkdir to pathlib style
* moved figure creation into timeline on_compute_end(), removed create_timeline(), removed default logging info level from __init__
* removed history & timeline logging
* adds more detail to diagnostics.md
* Update docs/user-guide/diagnostics.md
Co-authored-by: Tom White <tom.e.white@gmail.com>
---------
Co-authored-by: Tom White <tom.e.white@gmail.com>
Copy file name to clipboardExpand all lines: docs/user-guide/diagnostics.md
+32-4Lines changed: 32 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,12 @@ Array `c` is coloured orange, which means it is materialized as a Zarr array. Ar
41
41
42
42
Similarly, the operation that produces `c` is shown in a lilac colour to signify that it runs tasks to produce the output. Operations `op-001` and `op-002` don't run any tasks since `a` and `b` are just small constant arrays.
43
43
44
-
## Progress bar
44
+
45
+
## Callbacks
46
+
47
+
You can pass callbacks to functions that call `compute`, such as {py:func}`store <cubed.store>` or {py:func}`to_zarr <cubed.to_zarr>`.
48
+
49
+
### Progress bar
45
50
46
51
You can display a progress bar to track your computation by passing callbacks to {py:meth}`compute() <cubed.Array.compute()>`:
47
52
@@ -53,14 +58,37 @@ You can display a progress bar to track your computation by passing callbacks to
This will work in Jupyter notebooks, and for all executors.
57
67
58
-
You can also pass callbacks to functions that call `compute`, such as {py:func}`store <cubed.store>` or {py:func}`to_zarr <cubed.to_zarr>`.
59
68
60
-
## History and timeline visualization
61
69
62
-
The history and timeline visualization callbacks can be used to find out how long tasks took to run, and how much memory they used.
70
+
### History
71
+
The history callback can be used to understand how long tasks took to run, and how much memory they used. The history callback will write [`events.csv`, `plan.csv` and `stats.csv`] to a new directory under the current directory with the schema `history/compute-{id}`.
72
+
63
73
74
+
```ipython
75
+
>>> from cubed.diagnostics.history import HistoryCallback
76
+
>>> hist = HistoryCallback()
77
+
>>> c.compute(callbacks=[hist])
78
+
```
79
+
80
+
81
+
### Timeline
64
82
The timeline visualization is useful to determine how much time was spent in worker startup, as well as how much stragglers affected the overall time of the computation. (Ideally, we want vertical lines on this plot, which would represent perfect horizontal scaling.)
65
83
84
+
The timeline callback will write a graphic `timeline.svg` to a directory with the schema `history/compute-{id}`.
85
+
86
+
87
+
```ipython
88
+
>>> from cubed.diagnostics.timeline import TimelineVisualizationCallback
0 commit comments