Refactor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "daqingest"
|
||||
version = "0.3.0-aa.5"
|
||||
version = "0.3.0-aa.6"
|
||||
authors = ["Dominik Werder <dominik.werder@gmail.com>"]
|
||||
edition = "2024"
|
||||
|
||||
|
||||
@@ -93,17 +93,17 @@ const POLL_READ_TIMEOUT: Duration = Duration::from_millis(1000 * 10);
|
||||
const DO_RATE_CHECK: bool = false;
|
||||
const CHANNEL_STATUS_PONG_QUIET: Duration = Duration::from_millis(1000 * 60 * 60);
|
||||
const METRICS_EMIT_IVL: Duration = Duration::from_millis(1000 * 1);
|
||||
const USE_BIN_WRITER: bool = false;
|
||||
const USE_BIN_WRITER: bool = true;
|
||||
|
||||
macro_rules! trace3 { ($($arg:expr),*) => ( if false { trace!($($arg),*); } ); }
|
||||
macro_rules! trace3 { ($($arg:tt)*) => ( if false { log::trace!($($arg)*); } ); }
|
||||
|
||||
macro_rules! trace4 { ($($arg:expr),*) => ( if false { trace!($($arg),*); } ); }
|
||||
macro_rules! trace4 { ($($arg:tt)*) => ( if false { log::trace!($($arg)*); } ); }
|
||||
|
||||
macro_rules! trace_flush_queue { ($($arg:expr),*) => ( if false { trace3!($($arg),*); } ); }
|
||||
macro_rules! trace_flush_queue { ($($arg:tt)*) => ( if false { trace3!($($arg)*); } ); }
|
||||
|
||||
macro_rules! trace_event_incoming { ($($arg:expr),*) => ( if false { trace!($($arg),*); } ); }
|
||||
macro_rules! trace_event_incoming { ($($arg:tt)*) => ( if false { log::trace!($($arg)*); } ); }
|
||||
|
||||
macro_rules! trace_monitor_stale { ($($arg:expr),*) => ( if false { trace!($($arg),*); } ); }
|
||||
macro_rules! trace_monitor_stale { ($($arg:tt)*) => ( if false { log::trace!($($arg)*); } ); }
|
||||
|
||||
fn dbg_chn_cid(cid: Cid, conn: &CaConn) -> bool {
|
||||
if let Some(name) = conn.name_by_cid(cid) {
|
||||
|
||||
@@ -122,10 +122,10 @@ impl BinsExp {
|
||||
self.inc_lsp();
|
||||
}
|
||||
|
||||
fn push_cnt_zero(&mut self, n: u32) {
|
||||
fn push_cnt_zero(&mut self, n: u32, lst: f32) {
|
||||
if self.cnt_zero_default.enabled() {
|
||||
for _ in 0..n {
|
||||
self.push_back_dont_care();
|
||||
self.push_back_cmm(0, lst, lst);
|
||||
}
|
||||
} else {
|
||||
self.skip_lsp(n);
|
||||
@@ -324,30 +324,11 @@ fn binwriter_nest01_00_case(cnt_zero_default: WriteCntZero, do_discard_front: Di
|
||||
}
|
||||
exp.push_back_cmm(2, 2.0, 2.0);
|
||||
exp.push_back_cmm(2, 2.0, 2.0);
|
||||
// if cnt_zero_default.enabled() {
|
||||
// for _ in 0..8 {
|
||||
// exp.push_back_dont_care();
|
||||
// }
|
||||
// } else {
|
||||
// exp.skip_lsp(8);
|
||||
// }
|
||||
exp.push_cnt_zero(8);
|
||||
exp.push_cnt_zero(8, 2.0);
|
||||
exp.push_back_cmm(1, 2.0, 2.0);
|
||||
if cnt_zero_default.enabled() {
|
||||
for _ in 0..19 {
|
||||
exp.push_back_dont_care();
|
||||
}
|
||||
} else {
|
||||
exp.skip_lsp(19);
|
||||
}
|
||||
exp.push_cnt_zero(19, 2.0);
|
||||
exp.push_back_cmm(1, 2.0, 2.0);
|
||||
if cnt_zero_default.enabled() {
|
||||
for _ in 0..39 {
|
||||
exp.push_back_dont_care();
|
||||
}
|
||||
} else {
|
||||
exp.skip_lsp(39);
|
||||
}
|
||||
exp.push_cnt_zero(39, 2.0);
|
||||
assert_eq!(exp.curlsp.0, 120);
|
||||
exp.push_back_cmm(1, 0., 0.);
|
||||
exp.cmp(&binscol).unwrap();
|
||||
@@ -377,20 +358,10 @@ fn binwriter_nest01_00_case(cnt_zero_default: WriteCntZero, do_discard_front: Di
|
||||
// assert 60s
|
||||
assert_eq!(exp.curlsp.0, 6);
|
||||
exp.push_back_cmm(1, 2.0, 2.0);
|
||||
if cnt_zero_default.enabled() {
|
||||
exp.push_back_cmm(0, 2.0, 2.0);
|
||||
} else {
|
||||
exp.skip_lsp(1);
|
||||
}
|
||||
exp.push_cnt_zero(1, 2.0);
|
||||
assert_eq!(exp.curlsp.0, 8);
|
||||
exp.push_back_cmm(1, 2.0, 2.0);
|
||||
if cnt_zero_default.enabled() {
|
||||
exp.push_back_cmm(0, 2.0, 2.0);
|
||||
exp.push_back_cmm(0, 2.0, 2.0);
|
||||
exp.push_back_cmm(0, 2.0, 2.0);
|
||||
} else {
|
||||
exp.skip_lsp(3);
|
||||
}
|
||||
exp.push_cnt_zero(3, 2.0);
|
||||
exp.cmp(&binscol).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user