write stage broadcast counters

This commit is contained in:
Anatoly Yakovenko 2018-07-17 15:54:58 -07:00 committed by Michael Vines
parent 4af556f70e
commit c2c48a5c3c
1 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,7 @@
//! stdout, and then sends the Entry to its output channel. //! stdout, and then sends the Entry to its output channel.
use bank::Bank; use bank::Bank;
use counter::Counter;
use crdt::Crdt; use crdt::Crdt;
use entry::Entry; use entry::Entry;
use entry_writer::EntryWriter; use entry_writer::EntryWriter;
@ -12,6 +13,7 @@ use result::{Error, Result};
use service::Service; use service::Service;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::io::Write; use std::io::Write;
use std::sync::atomic::AtomicUsize;
use std::sync::mpsc::{channel, Receiver, RecvTimeoutError}; use std::sync::mpsc::{channel, Receiver, RecvTimeoutError};
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use std::thread::{self, Builder, JoinHandle}; use std::thread::{self, Builder, JoinHandle};
@ -41,6 +43,8 @@ impl WriteStage {
let mut blobs = VecDeque::new(); let mut blobs = VecDeque::new();
entries.to_blobs(blob_recycler, &mut blobs); entries.to_blobs(blob_recycler, &mut blobs);
if !blobs.is_empty() { if !blobs.is_empty() {
inc_new_counter!("write_stage-broadcast_vote-count", votes.len());
inc_new_counter!("write_stage-broadcast_blobs-count", blobs.len());
trace!("broadcasting {}", blobs.len()); trace!("broadcasting {}", blobs.len());
blob_sender.send(blobs)?; blob_sender.send(blobs)?;
} }