Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subscriber: Introduce Registry; Refactor fmt::Subscriber in terms of Registry + Layers #420

Merged
merged 112 commits into from
Nov 14, 2019

Conversation

davidbarsky
Copy link
Member

@davidbarsky davidbarsky commented Nov 10, 2019

Motivation

(Note: this is a clone of #412 in order to make reviewing the changes as a cohesive whole easier.)

This branch introduces:

  • A registry build atop of sharded-slab. Layers are expected to consume this registry through the traits SpanData, LookupSpan, and LookupMetadata. Layer-specific data—such as formatted spans and events—are stored in theExtensions typemap. They are writable via the ExtensionsMut view struct of the typemap. This enables layers to read and write data that they are interested in.
  • The tracing_subscriber::fmt::Subscriber has been re-implemented in terms of tracing_subscriber::registry::Registry.
  • The event/field formatters in this module have been modified—in a non-backwards compatible way—to accept a tracing_subscriber::fmt::FmtContext. A similar structure existed in tracing_subscriber::fmt::Subscriber, but it was not previously publicly exposed.

Examples of composing layers to mimic the tracing_subscriber::fmt::Subscriber are forthcoming, most likely in a followup PR.

Resolves #135
Resolves #157
Resolves #391

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are a bunch of unrelated changes to examples in this PR (some of which I know are my fault). while I think a lot of the new code in the examples are more idiomatic, it would be better to change them in a separate branch, IMO.

tracing-subscriber/Cargo.toml Outdated Show resolved Hide resolved
examples/examples/fmt-stderr.rs Outdated Show resolved Hide resolved
examples/examples/attrs-args.rs Outdated Show resolved Hide resolved
examples/examples/attrs-basic.rs Outdated Show resolved Hide resolved
examples/examples/fmt/fmt.rs Outdated Show resolved Hide resolved
examples/examples/futures-proxy-server.rs Outdated Show resolved Hide resolved
examples/examples/futures-spawn.rs Outdated Show resolved Hide resolved
examples/examples/hyper-echo.rs Outdated Show resolved Hide resolved
examples/examples/tower-h2-client.rs Outdated Show resolved Hide resolved
examples/examples/tower-h2-server.rs Outdated Show resolved Hide resolved
@davidbarsky davidbarsky changed the title Dbarsky+eliza/registry Introduce Registry and Accociated Trait; Refactor fmt::Subscriber in terms of Layers Nov 10, 2019
@davidbarsky davidbarsky requested a review from hawkw November 10, 2019 22:27
@davidbarsky davidbarsky changed the title Introduce Registry and Accociated Trait; Refactor fmt::Subscriber in terms of Layers Introduce Registry; Refactor fmt::Subscriber in terms of Registry + Layers Nov 10, 2019
@hawkw
Copy link
Member

hawkw commented Nov 11, 2019

@davidbarsky did you ever get to run the subscriber benchmarks for this branch? I'd love to see results.

@davidbarsky
Copy link
Member Author

@hawkw My computer died yesterday, and then I ended up watching Watchmen. Here's the output of cargo bench on dbarsky+eliza/registry on a dual-core MacBook Pro on battery power. Let me know if you want me to rerun these benchmarks on a c3.8xlarge (32 Virtual CPUs, 60.0 GiB Memory).

tracing on dbarsky+eliza/registry [$?] via v1.39.0
❯ cargo bench
    Updating crates.io index
   Compiling tracing-subscriber v0.1.5 (/Users/dbarsky/Developer/Rust/tracing/tracing-subscriber)
    Finished release [optimized] target(s) in 1m 11s
     Running target/release/deps/tracing-182f3e85547e2319

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/release/deps/no_subscriber-b3d43a7ff4766447
no_subscriber/span      time:   [3.2743 ns 3.3780 ns 3.5021 ns]
                        change: [-17.494% -13.167% -8.7092%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  5 (5.00%) high mild
  6 (6.00%) high severe
no_subscriber/event     time:   [312.11 ps 320.32 ps 330.73 ps]
                        change: [-1.8040% +1.4756% +4.8633%] (p = 0.36 > 0.05)
                        No change in performance detected.
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe
no_subscriber/relaxed_load
                        time:   [834.02 ps 853.08 ps 878.05 ps]
                        change: [-0.6845% +1.6229% +4.2770%] (p = 0.21 > 0.05)
                        No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
  8 (8.00%) high severe
no_subscriber/acquire_load
                        time:   [822.18 ps 828.67 ps 836.35 ps]
                        change: [-2.7776% -1.0019% +0.6276%] (p = 0.25 > 0.05)
                        No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe
no_subscriber/log       time:   [315.87 ps 322.62 ps 331.23 ps]
                        change: [+2.6914% +5.6896% +9.0773%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 14 outliers among 100 measurements (14.00%)
  7 (7.00%) high mild
  7 (7.00%) high severe

no_subscriber_field/span
                        time:   [3.1007 ns 3.1567 ns 3.2287 ns]
                        change: [+0.4785% +4.6137% +9.1467%] (p = 0.03 < 0.05)
                        Change within noise threshold.
Found 6 outliers among 100 measurements (6.00%)
  1 (1.00%) high mild
  5 (5.00%) high severe
no_subscriber_field/event
                        time:   [319.65 ps 330.26 ps 342.16 ps]
                        change: [-2.2462% +1.8578% +5.2366%] (p = 0.36 > 0.05)
                        No change in performance detected.
Found 11 outliers among 100 measurements (11.00%)
  6 (6.00%) high mild
  5 (5.00%) high severe
no_subscriber_field/log time:   [314.07 ps 321.93 ps 332.41 ps]
                        change: [-31.365% -23.475% -16.867%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) high mild
  6 (6.00%) high severe

     Running target/release/deps/subscriber-30ba139e02788804
span_no_fields          time:   [37.490 ns 39.712 ns 42.255 ns]
                        change: [-23.580% -19.623% -15.239%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe

enter_span              time:   [6.8982 ns 8.0965 ns 9.4781 ns]
                        change: [-14.999% -6.4274% +4.5530%] (p = 0.19 > 0.05)
                        No change in performance detected.
Found 5 outliers among 100 measurements (5.00%)
  1 (1.00%) high mild
  4 (4.00%) high severe

span_repeatedly         time:   [5.3530 us 5.5775 us 5.7988 us]
                        change: [-35.083% -29.376% -23.585%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe

span_with_fields        time:   [138.30 ns 161.80 ns 185.27 ns]
                        change: [-3.4512% +13.507% +32.584%] (p = 0.14 > 0.05)
                        No change in performance detected.
Found 7 outliers among 100 measurements (7.00%)
  6 (6.00%) high mild
  1 (1.00%) high severe

span_with_fields_record time:   [565.95 ns 657.07 ns 767.20 ns]
                        change: [+8.9326% +25.945% +50.186%] (p = 0.01 < 0.05)
                        Performance has regressed.
Found 10 outliers among 100 measurements (10.00%)
  7 (7.00%) high mild
  3 (3.00%) high severe

dispatch/no_dispatch_get_ref
                        time:   [14.699 ns 16.416 ns 18.451 ns]
                        change: [-20.441% -5.4816% +13.121%] (p = 0.54 > 0.05)
                        No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe
dispatch/no_dispatch_get_clone
                        time:   [27.694 ns 30.071 ns 32.771 ns]
                        change: [-38.289% -30.877% -23.028%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  6 (6.00%) high mild
  3 (3.00%) high severe
dispatch/get_ref        time:   [9.5264 ns 9.7171 ns 9.9338 ns]
                        change: [-44.510% -38.866% -32.573%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
  8 (8.00%) high mild
  4 (4.00%) high severe
dispatch/get_clone      time:   [21.662 ns 21.935 ns 22.251 ns]
                        change: [-57.924% -51.875% -45.413%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
  3 (3.00%) high mild
  9 (9.00%) high severe

     Running target/release/deps/tracing_attributes-8ab2b62d9b7b4353

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/release/deps/tracing_core-6cb084cb2ac5d255

running 13 tests
test dispatcher::test::default_dispatch ... ignored
test dispatcher::test::default_no_subscriber ... ignored
test dispatcher::test::dispatch_downcasts ... ignored
test dispatcher::test::dispatch_is ... ignored
test dispatcher::test::events_dont_infinite_loop ... ignored
test dispatcher::test::spans_dont_infinite_loop ... ignored
test field::test::empty_value_set_is_empty ... ignored
test field::test::fields_from_other_callsets_are_skipped ... ignored
test field::test::record_debug_fn ... ignored
test field::test::sparse_value_sets_are_not_empty ... ignored
test field::test::value_set_with_no_values_is_empty ... ignored
test field::test::value_sets_with_fields_from_other_callsites_are_empty ... ignored
test metadata::tests::level_from_str ... ignored

test result: ok. 0 passed; 0 failed; 13 ignored; 0 measured; 0 filtered out

     Running target/release/deps/tracing_futures-8246eedda7b10c19

running 4 tests
test tests::futures_tests::future_enter_exit_is_reasonable ... ignored
test tests::futures_tests::future_error_ends_span ... ignored
test tests::futures_tests::span_follows_future_onto_threadpool ... ignored
test tests::futures_tests::stream_enter_exit_is_reasonable ... ignored

test result: ok. 0 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out

     Running target/release/deps/tracing_log-29c3557ac4d80bec

running 5 tests
test test::debug_callsite_is_correct ... ignored
test test::error_callsite_is_correct ... ignored
test test::info_callsite_is_correct ... ignored
test test::trace_callsite_is_correct ... ignored
test test::warn_callsite_is_correct ... ignored

test result: ok. 0 passed; 0 failed; 5 ignored; 0 measured; 0 filtered out

     Running target/release/deps/tracing_macros-bd8ecc39397eb20f

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/release/deps/tracing_serde-4f490dae7def4482

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/release/deps/tracing_subscriber-81f514218997632e

running 38 tests
test field::delimited::test::delimited_new_visitor ... ignored
test field::delimited::test::delimited_visitor ... ignored
test filter::env::directive::test::directive_ordering_by_field_num ... ignored
test filter::env::directive::test::directive_ordering_by_span ... ignored
test filter::env::directive::test::directive_ordering_by_target_len ... ignored
test filter::env::directive::test::directive_ordering_uses_lexicographic_when_equal ... ignored
test filter::env::directive::test::parse_directives_empty_level ... ignored
test filter::env::directive::test::parse_directives_global ... ignored
test filter::env::directive::test::parse_directives_invalid_crate ... ignored
test filter::env::directive::test::parse_directives_invalid_level ... ignored
test filter::env::directive::test::parse_directives_ralith ... ignored
test filter::env::directive::test::parse_directives_string_level ... ignored
test filter::env::directive::test::parse_directives_valid ... ignored
test filter::env::directive::test::parse_directives_valid_with_spans ... ignored
test filter::env::directive::test::parse_level_directives ... ignored
test filter::env::directive::test::parse_numeric_level_directives ... ignored
test filter::env::directive::test::parse_uppercase_level_directives ... ignored
test filter::env::tests::callsite_enabled_includes_span_directive ... ignored
test filter::env::tests::callsite_enabled_includes_span_directive_field ... ignored
test filter::env::tests::callsite_enabled_includes_span_directive_multiple_fields ... ignored
test filter::env::tests::callsite_enabled_no_span_directive ... ignored
test filter::env::tests::callsite_off ... ignored
test filter::env::tests::roundtrip ... ignored
test fmt::format::json::test::json ... ignored
test fmt::format::test::with_ansi_false ... ignored
test fmt::format::test::with_ansi_true ... ignored
test fmt::test::impls ... ignored
test fmt::test::is_lookup_meta ... ignored
test fmt::test::subscriber_downcasts ... ignored
test fmt::test::subscriber_downcasts_to_parts ... ignored
test fmt::writer::test::custom_writer_closure ... ignored
test fmt::writer::test::custom_writer_struct ... ignored
test layer::tests::downcasts_to_layer ... ignored
test layer::tests::downcasts_to_subscriber ... ignored
test layer::tests::layer_is_subscriber ... ignored
test layer::tests::three_layers_are_subscriber ... ignored
test layer::tests::two_layers_are_subscriber ... ignored
test registry::extensions::test_extensions ... ignored

test result: ok. 0 passed; 0 failed; 38 ignored; 0 measured; 0 filtered out

     Running target/release/deps/filter-48c9c17213f7b805
static/baseline_single_threaded
                        time:   [118.99 ns 127.28 ns 136.35 ns]
                        change: [-28.696% -23.763% -18.040%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe
static/single_threaded  time:   [75.347 ns 83.055 ns 92.585 ns]
                        change: [-42.310% -30.637% -15.961%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe
static/baseline_multithreaded
                        time:   [39.431 us 47.452 us 56.448 us]
                        change: [-16.239% +9.3296% +40.838%] (p = 0.53 > 0.05)
                        No change in performance detected.
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe
static/multithreaded    time:   [27.723 us 28.979 us 30.321 us]
                        change: [-24.487% -14.467% -2.4270%] (p = 0.01 < 0.05)
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe

dynamic/baseline_single_threaded
                        time:   [211.69 ns 217.76 ns 224.21 ns]
                        change: [-37.036% -32.663% -28.086%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe
dynamic/single_threaded time:   [1.4022 us 1.5980 us 1.8363 us]
                        change: [-57.470% -45.504% -29.103%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) high mild
  7 (7.00%) high severe
dynamic/baseline_multithreaded
                        time:   [29.514 us 31.014 us 32.699 us]
                        change: [-64.482% -56.698% -47.138%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  5 (5.00%) high mild
  1 (1.00%) high severe
dynamic/multithreaded   time:   [40.367 us 43.550 us 47.294 us]
                        change: [-27.134% -12.081% +4.1329%] (p = 0.15 > 0.05)
                        No change in performance detected.
Found 18 outliers among 100 measurements (18.00%)
  8 (8.00%) high mild
  10 (10.00%) high severe

     Running target/release/deps/tracing_tower-3a093e1f1fa97fed

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

@davidbarsky
Copy link
Member Author

These are the benchmarks on the master branch:

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Benchmarking no_subscriber/span
Benchmarking no_subscriber/span: Warming up for 3.0000 s
Benchmarking no_subscriber/span: Collecting 100 samples in estimated 5.0000 s (1.6B iterations)
Benchmarking no_subscriber/span: Analyzing
no_subscriber/span      time:   [3.2469 ns 3.5243 ns 3.8837 ns]
                        change: [+1.6618% +8.6209% +17.010%] (p = 0.02 < 0.05)
                        Performance has regressed.
Found 11 outliers among 100 measurements (11.00%)
  5 (5.00%) high mild
  6 (6.00%) high severe
Benchmarking no_subscriber/event
Benchmarking no_subscriber/event: Warming up for 3.0000 s
Benchmarking no_subscriber/event: Collecting 100 samples in estimated 5.0000 s (15B iterations)
Benchmarking no_subscriber/event: Analyzing
no_subscriber/event     time:   [315.89 ps 323.12 ps 331.15 ps]
                        change: [-18.801% -14.138% -9.4060%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  9 (9.00%) high mild
  1 (1.00%) high severe
Benchmarking no_subscriber/relaxed_load
Benchmarking no_subscriber/relaxed_load: Warming up for 3.0000 s
Benchmarking no_subscriber/relaxed_load: Collecting 100 samples in estimated 5.0000 s (5.7B iterations)
Benchmarking no_subscriber/relaxed_load: Analyzing
no_subscriber/relaxed_load
                        time:   [855.91 ps 874.36 ps 895.05 ps]
                        change: [-11.659% -8.0924% -4.5285%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  5 (5.00%) high mild
  1 (1.00%) high severe
Benchmarking no_subscriber/acquire_load
Benchmarking no_subscriber/acquire_load: Warming up for 3.0000 s
Benchmarking no_subscriber/acquire_load: Collecting 100 samples in estimated 5.0000 s (5.8B iterations)
Benchmarking no_subscriber/acquire_load: Analyzing
no_subscriber/acquire_load
                        time:   [847.49 ps 882.34 ps 939.95 ps]
                        change: [+0.3383% +2.8189% +5.7752%] (p = 0.03 < 0.05)
                        Change within noise threshold.
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
Benchmarking no_subscriber/log
Benchmarking no_subscriber/log: Warming up for 3.0000 s
Benchmarking no_subscriber/log: Collecting 100 samples in estimated 5.0000 s (13B iterations)
Benchmarking no_subscriber/log: Analyzing
no_subscriber/log       time:   [346.40 ps 372.87 ps 407.38 ps]
                        change: [+26.991% +38.123% +51.470%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 11 outliers among 100 measurements (11.00%)
  7 (7.00%) high mild
  4 (4.00%) high severe

Benchmarking no_subscriber_field/span
Benchmarking no_subscriber_field/span: Warming up for 3.0000 s
Benchmarking no_subscriber_field/span: Collecting 100 samples in estimated 5.0000 s (1.6B iterations)
Benchmarking no_subscriber_field/span: Analyzing
no_subscriber_field/span
                        time:   [3.2489 ns 3.4224 ns 3.6455 ns]
                        change: [+7.4881% +15.575% +26.442%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe
Benchmarking no_subscriber_field/event
Benchmarking no_subscriber_field/event: Warming up for 3.0000 s
Benchmarking no_subscriber_field/event: Collecting 100 samples in estimated 5.0000 s (11B iterations)
Benchmarking no_subscriber_field/event: Analyzing
no_subscriber_field/event
                        time:   [319.88 ps 338.98 ps 361.72 ps]
                        change: [-19.242% -11.439% -3.3770%] (p = 0.01 < 0.05)
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe
Benchmarking no_subscriber_field/log
Benchmarking no_subscriber_field/log: Warming up for 3.0000 s
Benchmarking no_subscriber_field/log: Collecting 100 samples in estimated 5.0000 s (14B iterations)
Benchmarking no_subscriber_field/log: Analyzing
no_subscriber_field/log time:   [336.97 ps 364.44 ps 395.72 ps]
                        change: [-27.672% -21.045% -14.160%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 15 outliers among 100 measurements (15.00%)
  4 (4.00%) high mild
  11 (11.00%) high severe

Benchmarking span_no_fields
Benchmarking span_no_fields: Warming up for 3.0000 s
Benchmarking span_no_fields: Collecting 100 samples in estimated 5.0002 s (141M iterations)
Benchmarking span_no_fields: Analyzing
span_no_fields          time:   [48.625 ns 50.648 ns 53.193 ns]
                        change: [+40.559% +46.186% +53.084%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) high mild
  5 (5.00%) high severe

Benchmarking enter_span
Benchmarking enter_span: Warming up for 3.0000 s
Benchmarking enter_span: Collecting 100 samples in estimated 5.0000 s (566M iterations)
Benchmarking enter_span: Analyzing
enter_span              time:   [5.4084 ns 5.5751 ns 5.7764 ns]
                        change: [+10.321% +15.640% +21.015%] (p = 0.00 < 0.05)
                        Performance has regressed.

Benchmarking span_repeatedly
Benchmarking span_repeatedly: Warming up for 3.0000 s
Benchmarking span_repeatedly: Collecting 100 samples in estimated 5.0008 s (874k iterations)
Benchmarking span_repeatedly: Analyzing
span_repeatedly         time:   [5.1053 us 5.4735 us 5.9198 us]
                        change: [+21.724% +30.905% +40.480%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 4 outliers among 100 measurements (4.00%)
  3 (3.00%) high mild
  1 (1.00%) high severe

Benchmarking span_with_fields
Benchmarking span_with_fields: Warming up for 3.0000 s
Benchmarking span_with_fields: Collecting 100 samples in estimated 5.0002 s (55M iterations)
Benchmarking span_with_fields: Analyzing
span_with_fields        time:   [81.072 ns 93.634 ns 108.15 ns]
                        change: [+27.437% +43.465% +62.308%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 10 outliers among 100 measurements (10.00%)
  3 (3.00%) high mild
  7 (7.00%) high severe

Benchmarking span_with_fields_record
Benchmarking span_with_fields_record: Warming up for 3.0000 s
Benchmarking span_with_fields_record: Collecting 100 samples in estimated 5.0003 s (5.2M iterations)
Benchmarking span_with_fields_record: Analyzing
span_with_fields_record time:   [480.05 ns 517.72 ns 556.58 ns]
                        change: [+5.0897% +14.463% +25.067%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 10 outliers among 100 measurements (10.00%)
  6 (6.00%) high mild
  4 (4.00%) high severe

Benchmarking dispatch/no_dispatch_get_ref
Benchmarking dispatch/no_dispatch_get_ref: Warming up for 3.0000 s
Benchmarking dispatch/no_dispatch_get_ref: Collecting 100 samples in estimated 5.0000 s (308M iterations)
Benchmarking dispatch/no_dispatch_get_ref: Analyzing
dispatch/no_dispatch_get_ref
                        time:   [15.098 ns 16.463 ns 18.144 ns]
                        change: [+45.908% +78.503% +115.20%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) high mild
  7 (7.00%) high severe
Benchmarking dispatch/no_dispatch_get_clone
Benchmarking dispatch/no_dispatch_get_clone: Warming up for 3.0000 s
Benchmarking dispatch/no_dispatch_get_clone: Collecting 100 samples in estimated 5.0001 s (210M iterations)
Benchmarking dispatch/no_dispatch_get_clone: Analyzing
dispatch/no_dispatch_get_clone
                        time:   [24.527 ns 25.634 ns 26.845 ns]
                        change: [-4.5631% -1.0464% +2.8065%] (p = 0.58 > 0.05)
                        No change in performance detected.
Found 18 outliers among 100 measurements (18.00%)
  7 (7.00%) high mild
  11 (11.00%) high severe
Benchmarking dispatch/get_ref
Benchmarking dispatch/get_ref: Warming up for 3.0000 s
Benchmarking dispatch/get_ref: Collecting 100 samples in estimated 5.0001 s (103M iterations)
Benchmarking dispatch/get_ref: Analyzing
dispatch/get_ref        time:   [18.991 ns 22.882 ns 27.534 ns]
                        change: [-30.213% -16.102% +2.2432%] (p = 0.08 > 0.05)
                        No change in performance detected.
Found 6 outliers among 100 measurements (6.00%)
  5 (5.00%) high mild
  1 (1.00%) high severe
Benchmarking dispatch/get_clone
Benchmarking dispatch/get_clone: Warming up for 3.0000 s
Benchmarking dispatch/get_clone: Collecting 100 samples in estimated 5.0000 s (138M iterations)
Benchmarking dispatch/get_clone: Analyzing
dispatch/get_clone      time:   [30.765 ns 33.981 ns 37.717 ns]
                        change: [-5.9053% +8.3160% +26.414%] (p = 0.30 > 0.05)
                        No change in performance detected.
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out


running 13 tests
test dispatcher::test::default_dispatch ... ignored
test dispatcher::test::default_no_subscriber ... ignored
test dispatcher::test::dispatch_downcasts ... ignored
test dispatcher::test::dispatch_is ... ignored
test dispatcher::test::events_dont_infinite_loop ... ignored
test dispatcher::test::spans_dont_infinite_loop ... ignored
test field::test::empty_value_set_is_empty ... ignored
test field::test::fields_from_other_callsets_are_skipped ... ignored
test field::test::record_debug_fn ... ignored
test field::test::sparse_value_sets_are_not_empty ... ignored
test field::test::value_set_with_no_values_is_empty ... ignored
test field::test::value_sets_with_fields_from_other_callsites_are_empty ... ignored
test metadata::tests::level_from_str ... ignored

test result: ok. 0 passed; 0 failed; 13 ignored; 0 measured; 0 filtered out


running 4 tests
test tests::futures_tests::future_enter_exit_is_reasonable ... ignored
test tests::futures_tests::future_error_ends_span ... ignored
test tests::futures_tests::span_follows_future_onto_threadpool ... ignored
test tests::futures_tests::stream_enter_exit_is_reasonable ... ignored

test result: ok. 0 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out


running 5 tests
test test::debug_callsite_is_correct ... ignored
test test::error_callsite_is_correct ... ignored
test test::info_callsite_is_correct ... ignored
test test::trace_callsite_is_correct ... ignored
test test::warn_callsite_is_correct ... ignored

test result: ok. 0 passed; 0 failed; 5 ignored; 0 measured; 0 filtered out


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out


running 36 tests
test field::delimited::test::delimited_new_visitor ... ignored
test field::delimited::test::delimited_visitor ... ignored
test filter::env::directive::test::directive_ordering_by_field_num ... ignored
test filter::env::directive::test::directive_ordering_by_span ... ignored
test filter::env::directive::test::directive_ordering_by_target_len ... ignored
test filter::env::directive::test::directive_ordering_uses_lexicographic_when_equal ... ignored
test filter::env::directive::test::parse_directives_empty_level ... ignored
test filter::env::directive::test::parse_directives_global ... ignored
test filter::env::directive::test::parse_directives_invalid_crate ... ignored
test filter::env::directive::test::parse_directives_invalid_level ... ignored
test filter::env::directive::test::parse_directives_ralith ... ignored
test filter::env::directive::test::parse_directives_string_level ... ignored
test filter::env::directive::test::parse_directives_valid ... ignored
test filter::env::directive::test::parse_directives_valid_with_spans ... ignored
test filter::env::directive::test::parse_level_directives ... ignored
test filter::env::directive::test::parse_numeric_level_directives ... ignored
test filter::env::directive::test::parse_uppercase_level_directives ... ignored
test filter::env::tests::callsite_enabled_includes_span_directive ... ignored
test filter::env::tests::callsite_enabled_includes_span_directive_field ... ignored
test filter::env::tests::callsite_enabled_includes_span_directive_multiple_fields ... ignored
test filter::env::tests::callsite_enabled_no_span_directive ... ignored
test filter::env::tests::callsite_off ... ignored
test filter::env::tests::roundtrip ... ignored
test fmt::format::test::with_ansi_false ... ignored
test fmt::format::test::with_ansi_true ... ignored
test fmt::test::impls ... ignored
test fmt::test::subscriber_downcasts ... ignored
test fmt::test::subscriber_downcasts_to_parts ... ignored
test fmt::writer::test::custom_writer_closure ... ignored
test fmt::writer::test::custom_writer_struct ... ignored
test layer::tests::downcasts_to_layer ... ignored
test layer::tests::downcasts_to_subscriber ... ignored
test layer::tests::layer_is_subscriber ... ignored
test layer::tests::three_layers_are_subscriber ... ignored
test layer::tests::two_layers_are_subscriber ... ignored
test reload::test::reload_handle ... ignored

test result: ok. 0 passed; 0 failed; 36 ignored; 0 measured; 0 filtered out

Benchmarking static/baseline_single_threaded
Benchmarking static/baseline_single_threaded: Warming up for 3.0000 s
Benchmarking static/baseline_single_threaded: Collecting 100 samples in estimated 5.0001 s (44M iterations)
Benchmarking static/baseline_single_threaded: Analyzing
static/baseline_single_threaded
                        time:   [105.13 ns 108.80 ns 112.90 ns]
                        change: [-25.765% -17.914% -9.5302%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
  7 (7.00%) high mild
  6 (6.00%) high severe
Benchmarking static/single_threaded
Benchmarking static/single_threaded: Warming up for 3.0000 s
Benchmarking static/single_threaded: Collecting 100 samples in estimated 5.0001 s (77M iterations)
Benchmarking static/single_threaded: Analyzing
static/single_threaded  time:   [68.209 ns 72.955 ns 78.502 ns]
                        change: [-2.4597% +6.9878% +16.696%] (p = 0.13 > 0.05)
                        No change in performance detected.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
Benchmarking static/baseline_multithreaded
Benchmarking static/baseline_multithreaded: Warming up for 3.0000 s
Benchmarking static/baseline_multithreaded: Collecting 100 samples in estimated 5.5485 s (30k iterations)
Benchmarking static/baseline_multithreaded: Analyzing
static/baseline_multithreaded
                        time:   [24.193 us 25.175 us 26.179 us]
                        change: [-47.644% -41.371% -34.061%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 22 outliers among 100 measurements (22.00%)
  2 (2.00%) low severe
  11 (11.00%) low mild
  7 (7.00%) high mild
  2 (2.00%) high severe
Benchmarking static/multithreaded
Benchmarking static/multithreaded: Warming up for 3.0000 s
Benchmarking static/multithreaded: Collecting 100 samples in estimated 5.4445 s (35k iterations)
Benchmarking static/multithreaded: Analyzing
static/multithreaded    time:   [23.831 us 24.726 us 25.711 us]
                        change: [-37.645% -28.834% -18.927%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 15 outliers among 100 measurements (15.00%)
  3 (3.00%) low mild
  3 (3.00%) high mild
  9 (9.00%) high severe

Benchmarking dynamic/baseline_single_threaded
Benchmarking dynamic/baseline_single_threaded: Warming up for 3.0000 s
Benchmarking dynamic/baseline_single_threaded: Collecting 100 samples in estimated 5.0011 s (23M iterations)
Benchmarking dynamic/baseline_single_threaded: Analyzing
dynamic/baseline_single_threaded
                        time:   [195.77 ns 200.93 ns 207.04 ns]
                        change: [-32.047% -26.839% -21.172%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 15 outliers among 100 measurements (15.00%)
  6 (6.00%) high mild
  9 (9.00%) high severe
Benchmarking dynamic/single_threaded
Benchmarking dynamic/single_threaded: Warming up for 3.0000 s
Benchmarking dynamic/single_threaded: Collecting 100 samples in estimated 5.0022 s (5.5M iterations)
Benchmarking dynamic/single_threaded: Analyzing
dynamic/single_threaded time:   [873.22 ns 893.93 ns 918.79 ns]
                        change: [-16.190% -11.284% -6.4624%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
  4 (4.00%) high mild
  9 (9.00%) high severe
Benchmarking dynamic/baseline_multithreaded
Benchmarking dynamic/baseline_multithreaded: Warming up for 3.0000 s
Benchmarking dynamic/baseline_multithreaded: Collecting 100 samples in estimated 5.5039 s (35k iterations)
Benchmarking dynamic/baseline_multithreaded: Analyzing
dynamic/baseline_multithreaded
                        time:   [25.337 us 26.403 us 27.516 us]
                        change: [-59.326% -50.510% -40.605%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 19 outliers among 100 measurements (19.00%)
  1 (1.00%) low severe
  9 (9.00%) low mild
  5 (5.00%) high mild
  4 (4.00%) high severe
Benchmarking dynamic/multithreaded
Benchmarking dynamic/multithreaded: Warming up for 3.0000 s
Benchmarking dynamic/multithreaded: Collecting 100 samples in estimated 5.2905 s (30k iterations)
Benchmarking dynamic/multithreaded: Analyzing
dynamic/multithreaded   time:   [33.625 us 34.240 us 34.954 us]
                        change: [-42.037% -33.002% -23.793%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 19 outliers among 100 measurements (19.00%)
  9 (9.00%) low severe
  4 (4.00%) low mild
  3 (3.00%) high mild
  3 (3.00%) high severe


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

@davidbarsky
Copy link
Member Author

Just focusing on tracing-subscriber:

master

     Running /Users/dbarsky/Developer/Rust/tracing/target/release/deps/filter-e7f47ba1ad6bfd6d
static/baseline_single_threaded
                        time:   [105.78 ns 108.62 ns 111.81 ns]
                        change: [-4.7004% +0.4458% +5.8120%] (p = 0.87 > 0.05)
                        No change in performance detected.
Found 10 outliers among 100 measurements (10.00%)
  8 (8.00%) high mild
  2 (2.00%) high severe
static/single_threaded  time:   [59.628 ns 62.143 ns 65.421 ns]
                        change: [-18.827% -12.393% -5.7288%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
  6 (6.00%) high mild
  7 (7.00%) high severe
static/baseline_multithreaded
                        time:   [27.215 us 28.790 us 30.419 us]
                        change: [+7.4179% +14.644% +22.615%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) low mild
  3 (3.00%) high mild
  4 (4.00%) high severe
static/multithreaded    time:   [32.952 us 35.747 us 39.384 us]
                        change: [+26.726% +37.496% +49.176%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 7 outliers among 100 measurements (7.00%)
  3 (3.00%) high mild
  4 (4.00%) high severe

dynamic/baseline_single_threaded
                        time:   [229.93 ns 243.98 ns 259.63 ns]
                        change: [+12.841% +25.791% +44.051%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) high mild
  6 (6.00%) high severe
dynamic/single_threaded time:   [1.5142 us 1.6465 us 1.8021 us]
                        change: [+114.79% +144.52% +177.52%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 14 outliers among 100 measurements (14.00%)
  8 (8.00%) high mild
  6 (6.00%) high severe
dynamic/baseline_multithreaded
                        time:   [68.970 us 86.120 us 108.15 us]
                        change: [+161.68% +210.42% +260.48%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe
dynamic/multithreaded   time:   [62.718 us 68.490 us 75.469 us]
                        change: [+130.04% +176.46% +239.75%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe

dbarsky+eliza/registry

     Running /Users/dbarsky/Developer/Rust/tracing/target/release/deps/filter-0fa4bc10b4f079af
static/baseline_single_threaded
                        time:   [111.89 ns 116.85 ns 122.52 ns]
                        change: [+5.5957% +11.344% +18.026%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe
static/single_threaded  time:   [59.823 ns 64.440 ns 70.843 ns]
                        change: [-0.4172% +16.993% +35.861%] (p = 0.07 > 0.05)
                        No change in performance detected.
Found 18 outliers among 100 measurements (18.00%)
  4 (4.00%) high mild
  14 (14.00%) high severe
static/baseline_multithreaded
                        time:   [31.380 us 41.249 us 54.791 us]
                        change: [+19.781% +43.784% +79.985%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 15 outliers among 100 measurements (15.00%)
  6 (6.00%) high mild
  9 (9.00%) high severe
static/multithreaded    time:   [26.844 us 27.966 us 29.208 us]
                        change: [-21.985% -10.834% +4.4456%] (p = 0.09 > 0.05)
                        No change in performance detected.
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe

dynamic/baseline_single_threaded
                        time:   [220.84 ns 231.55 ns 244.55 ns]
                        change: [-24.761% -14.204% -4.2614%] (p = 0.01 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  6 (6.00%) high mild
  1 (1.00%) high severe
dynamic/single_threaded time:   [1.1509 us 1.2682 us 1.4083 us]
                        change: [-49.038% -37.692% -23.087%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 16 outliers among 100 measurements (16.00%)
  6 (6.00%) high mild
  10 (10.00%) high severe
dynamic/baseline_multithreaded
                        time:   [28.918 us 33.171 us 38.491 us]
                        change: [-67.953% -61.967% -54.693%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  4 (4.00%) high severe
dynamic/multithreaded   time:   [45.525 us 51.328 us 57.855 us]
                        change: [-57.453% -46.718% -34.624%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 14 outliers among 100 measurements (14.00%)
  2 (2.00%) high mild
  12 (12.00%) high severe

To be entirely honest, I'm not sure how Criterion determines if there's a regression or improvement in performance—I don't know values it's comparing against.

hawkw added a commit that referenced this pull request Nov 11, 2019
These benchmarks were originally written for assessing before/after
performance on a branch that was not merged. However, they are probably
generally useful for other fmt subscriber changes (e.g. #420).

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw
Copy link
Member

hawkw commented Nov 11, 2019

@davidbarsky I don't think any of those benchmarks actually measure FmtSubscriber performance; they're all focused on filters. That's my bad, sorry: I had written some benchmarks for fmt in a separate branch, but I guess they never actually merged. PR #421 adds fmt benchmarks, and when that merges we can rebase this branch and run the fmt benches.

davidbarsky pushed a commit that referenced this pull request Nov 11, 2019
These benchmarks were originally written for assessing before/after
performance on a branch that was not merged. However, they are probably
generally useful for other fmt subscriber changes (e.g. #420).

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
hawkw and others added 15 commits November 11, 2019 15:45
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Co-authored-by: David Barsky <dbarsky@amazon.com>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Co-authored-by: David Barsky <dbarsky@amazon.com>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some docs edits

tracing-subscriber/src/registry/extensions.rs Outdated Show resolved Hide resolved
Comment on lines 66 to 79
/// If a extension of this type already exists, it will
/// be returned. Note that extensions are _not_
/// `Layer`-specific—they are _span_-specific. This means that
/// other layers can access and mutate extensions that
/// a different Layer recorded. For example, an application might
/// have a layer that records execution timings alongside a layer
/// that reports spans and events to a distributed
/// tracing system that requires timestamps for spans.
/// Ideally, if one layer records a timestamp _x_, the other layer
/// should be able to reuse timestamp _x_.
///
/// Therefore, extensions should generally be newtypes, rather than common
/// types like [`String`](std::string::String), to avoid accidnental
/// cross-`Layer` clobbering.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this maybe could be clearer, but i'm not immediately sure how. i'm also not convinced that discussing this on the method docs for insert is the right place; maybe it should be part of a higher-level description of extensions...but i'm fine with editing the docs later.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be clearer, and yeah—this should go somewhere else. A module-level discussion, maybe?

tracing-subscriber/src/registry/extensions.rs Outdated Show resolved Hide resolved
tracing-subscriber/src/registry/sharded.rs Outdated Show resolved Hide resolved
tracing-subscriber/src/registry/sharded.rs Outdated Show resolved Hide resolved
tracing-subscriber/src/registry/sharded.rs Outdated Show resolved Hide resolved
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me (modulo a couple last minute nits). Thanks so much for all your work on this, @davidbarsky!

@jonhoo do you want to give this another review before it merges?

tracing-subscriber/Cargo.toml Outdated Show resolved Hide resolved
Comment on lines +13 to +14
/// A "separate current span" for each thread is a semantic choice, as each span
/// can be executing in a different thread.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure if i would say that this is a semantic choice we're making here in particular as much as it's the generally expected semantics for spans...not going to block on a comment on an internal api, though.

@davidbarsky
Copy link
Member Author

Followup issues to this PR:

  1. Move visit_spans to the layer::Context; make it return an iterator.
  2. Performance improvements with regard to pooling/allocation reduction.
  3. Callbacks for Layer::on_close, enabling Layers to read—what they perceive to be—a just closed span.
  4. Collapsing impl blocks on fmt::Layer.
  5. Examples for fmt::Layer and fmt::LayerBuilder.
  6. Additional unit tests for fetching/mutating the formatted fields in fmt::Layer. External examples would also be useful for those implementing their own layers.
  7. Implement FollowsFrom.
  8. A trait that overrides the "current thread" strategy that Registry currently uses.
  9. Address all the unresolved documentation comments on this PR. The issue will reference the specific comments (thanks, @jonhoo!).

(These all need to be separate issues, but I wanted to place this somewhere until I get the chance to create these)

@davidbarsky davidbarsky changed the title Introduce Registry; Refactor fmt::Subscriber in terms of Registry + Layers subscriber: Introduce Registry; Refactor fmt::Subscriber in terms of Registry + Layers Nov 14, 2019
@davidbarsky davidbarsky merged commit 919a628 into master Nov 14, 2019
@samscott89
Copy link
Contributor

@davidbarsky, if you're collecting follow ups here. FmtContext is now not exposed outside the crate, so it's not possible to have custom FormatEvent impls any more.

@hawkw
Copy link
Member

hawkw commented Nov 14, 2019

@SamScott that was definitely meant to be re-exported, I thought I added a re-export in fmt... would you or @davidbarsky mind opening a ticket for that?

@davidbarsky
Copy link
Member Author

Yep, that’s a bug. We should fix that. If it’s blocking you, feel free to cut a PR and I’ll review it.

@davidbarsky
Copy link
Member Author

@samscott89 I opened a pull request to address this: #425. Thanks for catching this!

davidbarsky added a commit that referenced this pull request Nov 14, 2019
With #420, we introduced FmtContext and made it a required parameter on
FormatEvent's primary methods. However, we forgot to export it, making
it impossible to write custom FormatEvent implementations. This PR fixes
that oversight. Thanks to @samscott89 for noticing this!

Signed-off-by: David Barsky me@davidbarsky.com
@samscott89
Copy link
Contributor

@davidbarsky, woah! Thanks for getting that fixed super fast. It wasn't blocking anything, actually the new API meant I could even throw away the code which needed the format event bits :)

I have been using this PR to start writing some PoC/MVP style tracing to honeycomb and zipkin... Works so easily, it's wonderful.

@davidbarsky
Copy link
Member Author

@samscott89: Glad to hear! You’ll probably need #429 to export Honeycomb-style spans on close; I’ve started work on the second option that Eliza mentioned in her comment. PR forthcoming.

@hawkw
Copy link
Member

hawkw commented Nov 15, 2019

I have been using this PR to start writing some PoC/MVP style tracing to honeycomb and zipkin... Works so easily, it's wonderful.

@samscott89 BTW, @pkinsky is working on a Honeycomb/tracing integration crate; I believe it hasn't been updated to use the new APIs yet, and only provides a Subscriber implementation. Perhaps the two of you can work together?

@inanna-malick
Copy link
Contributor

inanna-malick commented Nov 16, 2019

👋 @samscott89 I just updated the master branch with some changes I had sitting in a branch (thanks for the code review, @hawkw!), I believe it's close to being ready to publish a v0.0.1 on crates.io (I just need to finish documentation, some CI, etc). I'd love to collaborate on refactoring it to use the new APIs!

@samscott89
Copy link
Contributor

Hey @pkinsky! That looks cool. There's definitely some similarities to the quick mvp version of this I wrote locally to make it happen.

I'll move this to an issue on your repo to keep things in a more sensible place (hope thats okay!).

hawkw added a commit that referenced this pull request Feb 4, 2020
0.2.0 (February 4, 2020)

Breaking Changes:

- **fmt**: Renamed `Context` to `FmtContext` (#420, #425)
- **fmt**: Renamed `Builder` to `SubscriberBuilder` (#420)
- **filter**: Removed `Filter`. Use `EnvFilter` instead (#434)

Added:

- **registry**: `Registry`, a reusable span store that `Layer`s can use
  a high-performance, in-memory store. (#420, #425, #432, #433, #435)
- **registry**: Added `LookupSpan` trait, implemented by `Subscriber`s
  to expose stored span data to `Layer`s (#420)
- **fmt**: Added `fmt::Layer`, to allow composing log formatting with
  other `Layer`s (#420)
- **fmt**: Added support for JSON field and event formatting (#377,
  #415)
- **filter**: Documentation for filtering directives (#554)

Changed:

- **fmt**: Renamed `Context` to `FmtContext` (#420, #425) (BREAKING)
- **fmt**: Renamed `Builder` to `SubscriberBuilder` (#420) (BREAKING)
- **fmt**: Reimplemented `fmt::Subscriber` in terms of the `Registry`
  and `Layer`s (#420)

Removed:

- **filter**: Removed `Filter`. Use `EnvFilter` instead (#434) (BREAKING)

Fixed:

- **fmt**: Fixed memory leaks in the slab used to store per-span data
  (3c35048)
- **fmt**: `fmt::SubscriberBuilder::init` not setting up `log`
  compatibility (#489)
- **fmt**: Spans closed by a child span closing not also closing _their_
  parents (#514)
- **Layer**: Fixed `Layered` subscribers failing to downcast to their
  own type (#549)
- **Layer**: Fixed `Layer::downcast_ref` returning invalid references
  (#454)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
hawkw added a commit that referenced this pull request Feb 4, 2020
# 0.2.0 (February 4, 2020)

### Breaking Changes

- **fmt**: Renamed `Context` to `FmtContext` (#420, #425)
- **fmt**: Renamed `Builder` to `SubscriberBuilder` (#420)
- **filter**: Removed `Filter`. Use `EnvFilter` instead (#434)

### Added

- **registry**: `Registry`, a `Subscriber` implementation that `Layer`s
  can use as a high-performance, in-memory span store. (#420, #425, 
  #432, #433, #435)
- **registry**: Added `LookupSpan` trait, implemented by `Subscriber`s
  to expose stored span data to `Layer`s (#420)
- **fmt**: Added `fmt::Layer`, to allow composing log formatting with
  other `Layer`s
- **fmt**: Added support for JSON field and event formatting (#377, 
  #415)
- **filter**: Documentation for filtering directives (#554)

### Changed

- **fmt**: Renamed `Context` to `FmtContext` (#420, #425) (BREAKING)
- **fmt**: Renamed `Builder` to `SubscriberBuilder` (#420) (BREAKING)
- **fmt**: Reimplemented `fmt::Subscriber` in terms of the `Registry`
  and `Layer`s (#420)

### Removed

- **filter**: Removed `Filter`. Use `EnvFilter` instead (#434) 
  (BREAKING)

### Fixed

- **fmt**: Fixed memory leaks in the slab used to store per-span data
  (3c35048)
- **fmt**: `fmt::SubscriberBuilder::init` not setting up `log` 
  compatibility (#489)
- **fmt**: Spans closed by a child span closing not also closing 
  _their_ parents (#514)
- **Layer**: Fixed `Layered` subscribers failing to downcast to their
  own type (#549)
- **Layer**: Fixed `Layer::downcast_ref` returning invalid references
  (#454)

Fixes #515
Fixes #458 

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants