Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@tomusdrw
Copy link
Contributor

Turns my half-baked, println-based validate transaction measuring branch into a proper tracing that may stay here for longer.

The code readability in executive is heavily impacted unfortunately, but I didn't find a good way to make it look nicer. The span and guard borrow relationship makes it super annoying to build a nicer API.
Added a bunch of runtime tracing helpers though, to make it easier to instrument pallets without anoying conditional compilation.

let at = at.clone();

self.pool.spawn_ok(futures_diagnose::diagnose("validate-transaction", async move {
let span = tracing::span!(tracing::Level::DEBUG, "validate_transaction::check_version");
Copy link
Member

@bkchr bkchr Apr 16, 2020

Choose a reason for hiding this comment

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

Goes into the direction what I proposed here: #5657 (comment)

@NikVolf

Copy link
Contributor

@mattrutherford mattrutherford left a comment

Choose a reason for hiding this comment

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

Good initiative here, definitely helps with readability/usability. I think actually readability in executive, although diminished by the addition of tracing, is not too bad, because the eye can filter the pattern of the macro and focus on the code contained within.

# Conflicts:
#	client/transaction-pool/Cargo.toml
@NikVolf NikVolf added A8-mergeoncegreen and removed A0-please_review Pull request needs code review. labels Apr 16, 2020
@NikVolf NikVolf added this to the 2.0 milestone Apr 16, 2020
Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

I'm no fan of the code bloat, but there seems to be not better way currently :(

@bkchr bkchr merged commit 9918b2e into master Apr 17, 2020
@bkchr bkchr deleted the td-tracing-validate branch April 17, 2020 06:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants