Skip to content

Conversation

gdanezis
Copy link
Collaborator

@gdanezis gdanezis commented Feb 17, 2021

  • Added profile module
  • Annotated task launch to use the profiler
  • Added async_profile script to make pretty graphs

The profiler requires the package graphviz and is used as follows:

$ fab local # (with debug=True)
$ python async_profile.py logs/node-0.log
$ dot -Tpng parentgraph.dot > parentgraph.png

@asonnino asonnino self-requested a review February 17, 2021 19:59
Copy link
Owner

@asonnino asonnino left a comment

Choose a reason for hiding this comment

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

I updated some of the tasks' names to better reflect the structure of the code.

})?;
let network_receiver = NetReceiver::new(address, tx_core.clone());
tokio::spawn(async move {
pspawn!("Net-Receiver", {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pspawn!("Net-Receiver", {
pspawn!("Consensus-Receiver", {


let mut network_sender = NetSender::new(rx_network);
tokio::spawn(async move {
pspawn!("Net-Sender", {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pspawn!("Net-Sender", {
pspawn!("Consensus-Sender", {

let (tx_inner, mut rx_inner): (_, Receiver<DriverMessage>) = channel(1000);
let mut waiting = FuturesUnordered::new();
tokio::spawn(async move {
pspawn!("Mempool", {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pspawn!("Mempool", {
pspawn!("Mempool-Driver", {


let front = Front::new(address, tx_client);
tokio::spawn(async move {
pspawn!("Simple-Mempool-Front", {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pspawn!("Simple-Mempool-Front", {
pspawn!("Mempool-Txs-Receiver", {


async fn spawn_worker(socket: TcpStream, peer: SocketAddr, deliver: Sender<Transaction>) {
tokio::spawn(async move {
pspawn!("Front-Worker", {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pspawn!("Front-Worker", {
pspawn!("Txs-Receiver-Worker", {

})?;
let network_receiver = NetReceiver::new(address, tx_core);
tokio::spawn(async move {
pspawn!("Simple-Mempool-Receiver", {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pspawn!("Simple-Mempool-Receiver", {
pspawn!("Mempool-Receiver", {


let mut network_sender = NetSender::new(rx_network);
tokio::spawn(async move {
pspawn!("Simple-Mempool-Sender", {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pspawn!("Simple-Mempool-Sender", {
pspawn!("Mempool-Sender", {

/* network_channel */ tx_network,
);
tokio::spawn(async move {
pspawn!("Core-Runner", {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pspawn!("Core-Runner", {
pspawn!("Mempool-Core", {

// Each worker handle a TCP connection with on address.
let (tx, mut rx) = channel(1000);
tokio::spawn(async move {
pspawn!(format!("Net-Sender-{:?}", address), {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pspawn!(format!("Net-Sender-{:?}", address), {
pspawn!(format!("Sender-Worker-{:?}", address), {


async fn spawn_worker(socket: TcpStream, peer: SocketAddr, deliver: Sender<Message>) {
tokio::spawn(async move {
pspawn!(format!("Net-Receiver-{:?}", peer), {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pspawn!(format!("Net-Receiver-{:?}", peer), {
pspawn!(format!("Receiver-Worker-{:?}", peer), {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants