Add one Jaeger span per relay parent (#2196)

* Add one Jaeger span per relay parent

This adds one Jaeger span per relay parent, instead of always creating
new spans per relay parent. This should improve the UI view, because
subsystems are now grouped below one common span.

* Fix doc tests

* Replace `PerLeaveSpan` to `PerLeafSpan`

* More renaming

* Moare

* Update node/subsystem/src/lib.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* Skip the spans

* Increase `spec_version`

Co-authored-by: Andronik Ordian <write@reusable.software>
This commit is contained in:
Bastian Köcher
2021-01-05 15:09:25 +01:00
committed by GitHub
parent ceb9e2161c
commit 5be092894e
32 changed files with 535 additions and 322 deletions
@@ -17,7 +17,7 @@
use super::*;
use assert_matches::assert_matches;
use polkadot_erasure_coding::{branches, obtain_chunks_v1 as obtain_chunks};
use polkadot_node_network_protocol::{view, ObservedRole};
use polkadot_node_network_protocol::{view, ObservedRole, our_view};
use polkadot_node_subsystem_util::TimeoutExt;
use polkadot_primitives::v1::{
AvailableData, BlockData, CandidateCommitments, CandidateDescriptor, GroupIndex,
@@ -398,7 +398,7 @@ async fn expect_chunks_network_message(
async fn change_our_view(
virtual_overseer: &mut test_helpers::TestSubsystemContextHandle<AvailabilityDistributionMessage>,
view: View,
view: OurView,
validator_public: &[ValidatorId],
ancestors: Vec<Hash>,
session_per_relay_parent: HashMap<Hash, SessionIndex>,
@@ -574,7 +574,7 @@ fn check_views() {
let genesis = Hash::repeat_byte(0xAA);
change_our_view(
&mut virtual_overseer,
view![current],
our_view![current],
&validator_public,
vec![ancestors[0], genesis],
hashmap! { current => 1, genesis => 1 },
@@ -641,7 +641,7 @@ fn check_views() {
peer_b_2 => view![ancestors[0]],
},
);
assert_eq!(view, view![current]);
assert_eq!(view, our_view![current]);
}
};
}
@@ -676,7 +676,7 @@ fn reputation_verification() {
change_our_view(
&mut virtual_overseer,
view![current],
our_view![current],
&validator_public,
vec![ancestors[0]],
hashmap! { current => 1 },
@@ -768,7 +768,7 @@ fn not_a_live_candidate_is_detected() {
change_our_view(
&mut virtual_overseer,
view![current],
our_view![current],
&validator_public,
vec![ancestors[0]],
hashmap! { current => 1 },
@@ -816,7 +816,7 @@ fn peer_change_view_before_us() {
change_our_view(
&mut virtual_overseer,
view![current],
our_view![current],
&validator_public,
vec![ancestors[0]],
hashmap! { current => 1 },
@@ -863,7 +863,7 @@ fn candidate_chunks_are_put_into_message_vault_when_candidate_is_first_seen() {
change_our_view(
&mut virtual_overseer,
view![ancestors[0]],
our_view![ancestors[0]],
&validator_public,
vec![ancestors[1]],
hashmap! { ancestors[0] => 1 },
@@ -879,7 +879,7 @@ fn candidate_chunks_are_put_into_message_vault_when_candidate_is_first_seen() {
change_our_view(
&mut virtual_overseer,
view![current],
our_view![current],
&validator_public,
vec![ancestors[0]],
hashmap! { current => 1 },
@@ -1218,7 +1218,7 @@ fn new_peer_gets_all_chunks_send() {
change_our_view(
&mut virtual_overseer,
view![current],
our_view![current],
&validator_public,
vec![ancestors[0]],
hashmap! { current => 1 },