Skip to content

Commit

Permalink
Show whether a task is blocking the main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Jan 29, 2024
1 parent 7dd0fe6 commit 021f7a8
Show file tree
Hide file tree
Showing 12 changed files with 843 additions and 780 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "tracing-durations-export"
version = "0.1.2"
version = "0.2.0"
edition = "2021"
description = "Record and visualize parallelism of tracing spans"
license = "MIT OR Apache-2.0"
Expand Down
8 changes: 8 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.2.0

* Show whether an active span is running on and blocking the main thread or whether it's running in a threadpool with `tokio::task::spawn_blocking`. `--color-top`/`color_top` gets split into two colors, color top main and color top threadpool. The former is used when the task is running on the main thread, the latter is used when it's offloaded to the threadpool.
* Colorblind friendly default colors (http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/#a-colorblind-friendly-palette):
* color top blocking: #E69F0088
* color top threadpool: #56B4E988
* color bottom: #E69F0088

## 0.1.2

* Add `--inline-field` / `inline_field` option: If the is only one field, display its value inline. Since the text is not limited to its box, text can overlap and become unreadable.
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ and open `traces.svg`.
For the plots at the beginning of the readme:

```shell
TRACING_DURATION_EXPORT=examples/cached_network.ndjson cargo run --example cached_network
cargo run --bin plot --features plot --features cli -- examples/cached_network.ndjson
cargo run --bin plot --features plot --features cli -- --multi-lane examples/cached_network.ndjson --output examples/cached_network_multi_lane.svg
```
Expand Down
224 changes: 112 additions & 112 deletions examples/cached_network.ndjson

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/cached_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async fn cached_network_request(api: &str, id: usize) -> String {

#[tokio::main]
async fn main() {
let (duration_layer, _guard) = if let Ok(location) = env::var("TRACING_DURATION_FILE") {
let (duration_layer, _guard) = if let Ok(location) = env::var("TRACING_DURATION_EXPORT") {
let (layer, guard) = DurationsLayerBuilder::default()
.durations_file(location)
.build()
Expand Down
Loading

0 comments on commit 021f7a8

Please sign in to comment.