Count # of messages broadcasted by each node (#21)
This commit is contained in:
parent
9d997e2b54
commit
fbd114f724
|
@ -143,6 +143,7 @@ impl MixNode {
|
||||||
node_id: id,
|
node_id: id,
|
||||||
mock_counter: 0,
|
mock_counter: 0,
|
||||||
step_id: 0,
|
step_id: 0,
|
||||||
|
num_messages_broadcasted: 0,
|
||||||
},
|
},
|
||||||
msg_gen_rng: ChaCha12Rng::from_rng(&mut rng_generator).unwrap(),
|
msg_gen_rng: ChaCha12Rng::from_rng(&mut rng_generator).unwrap(),
|
||||||
persistent_sender,
|
persistent_sender,
|
||||||
|
@ -217,7 +218,8 @@ impl Node for MixNode {
|
||||||
persistent_sender.send(msg).unwrap();
|
persistent_sender.send(msg).unwrap();
|
||||||
}
|
}
|
||||||
MixOutgoingMessage::FullyUnwrapped(_) => {
|
MixOutgoingMessage::FullyUnwrapped(_) => {
|
||||||
//TODO: increase counter and create a tracing event
|
self.state.num_messages_broadcasted += 1;
|
||||||
|
//TODO: create a tracing event
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ pub struct MixnodeState {
|
||||||
pub node_id: NodeId,
|
pub node_id: NodeId,
|
||||||
pub mock_counter: usize,
|
pub mock_counter: usize,
|
||||||
pub step_id: usize,
|
pub step_id: usize,
|
||||||
|
pub num_messages_broadcasted: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
|
|
Loading…
Reference in New Issue