Skip to content

Commit 7706e45

Browse files
authored
feat: Improve performance tracing feature (#1730)
1 parent 8d9e1f9 commit 7706e45

File tree

10 files changed

+557
-450
lines changed

10 files changed

+557
-450
lines changed

docs/source/contributor-guide/tracing.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@ under the License.
1919

2020
# Tracing
2121

22-
Tracing can be enabled by setting `spark.comet.tracing.enabled=true`. Additionally, enabling the `jemalloc`
23-
feature will enable tracing of native memory allocations.
22+
Tracing can be enabled by setting `spark.comet.tracing.enabled=true`.
23+
24+
With this feature enabled, each Spark executor will write a JSON event log file in
25+
Chrome's [Trace Event Format]. The file will be written to the executor's current working
26+
directory with the filename `comet-event-trace.json`.
27+
28+
[Trace Event Format]: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview?tab=t.0#heading=h.yr4qxyxotyw
29+
30+
Additionally, enabling the `jemalloc` feature will enable tracing of native memory allocations.
2431

2532
```shell
2633
make release COMET_FEATURES="jemalloc"
2734
```
2835

29-
With this feature enabled, each Spark executor will write a JSON event log file in
30-
Chrome's [Trace Event Format].
31-
32-
[Trace Event Format]: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview?tab=t.0#heading=h.yr4qxyxotyw
33-
3436
Example output:
3537

3638
```json
@@ -43,10 +45,20 @@ Example output:
4345
{ "name": "CometExecIterator_getNextBatch", "cat": "PERF", "ph": "B", "pid": 1, "tid": 5, "ts": 10109479156 },
4446
```
4547

46-
Traces can be viewed with [Trace Viewer].
48+
Traces can be viewed with [Trace Viewer].
4749

4850
[Trace Viewer]: https://github.com/catapult-project/catapult/blob/main/tracing/README.md
4951

5052
Example trace visualization:
5153

5254
![tracing](../_static/images/tracing.png)
55+
56+
## Definition of Labels
57+
58+
| Label | Meaning |
59+
| --------------------- | -------------------------------------------------------------- |
60+
| jvm_heapUsed | JVM heap memory usage of live objects for the executor process |
61+
| jemalloc_allocated | Native memory usage for the executor process |
62+
| task_memory_comet_NNN | Off-heap memory allocated by Comet for query execution |
63+
| task_memory_spark_NNN | On-heap & Off-heap memory allocated by Spark |
64+
| comet_shuffle_NNN | Off-heap memory allocated by Comet for columnar shuffle |

0 commit comments

Comments
 (0)