projects
/
dnsseed-rust
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Keep more log lines in case of giant terminals
[dnsseed-rust]
/
src
/
printer.rs
diff --git
a/src/printer.rs
b/src/printer.rs
index ba7173c4d120b758d4c904fe7db451dcd57f74b0..d9cf3752aed96dc3c4e4f4a2e8cef63bf7ab5de6 100644
(file)
--- a/
src/printer.rs
+++ b/
src/printer.rs
@@
-13,6
+13,7
@@
pub enum Stat {
ConnectionClosed,
V4RoutingTableSize(usize),
V6RoutingTableSize(usize),
ConnectionClosed,
V4RoutingTableSize(usize),
V6RoutingTableSize(usize),
+ RoutingTablePaths(usize),
}
struct Stats {
}
struct Stats {
@@
-21,6
+22,7
@@
struct Stats {
connection_count: u64,
v4_table_size: usize,
v6_table_size: usize,
connection_count: u64,
v4_table_size: usize,
v6_table_size: usize,
+ paths: usize,
}
pub struct Printer {
}
pub struct Printer {
@@
-35,6
+37,7
@@
impl Printer {
connection_count: 0,
v4_table_size: 0,
v6_table_size: 0,
connection_count: 0,
v4_table_size: 0,
v6_table_size: 0,
+ paths: 0,
}));
let thread_arc = Arc::clone(&stats);
std::thread::spawn(move || {
}));
let thread_arc = Arc::clone(&stats);
std::thread::spawn(move || {
@@
-62,12
+65,14
@@
impl Printer {
store.get_node_count(AddressState::from_num(i).unwrap())
).as_bytes()).expect("stdout broken?");
}
store.get_node_count(AddressState::from_num(i).unwrap())
).as_bytes()).expect("stdout broken?");
}
+ let generations = store.get_bloom_node_count();
+ out.write_all(b"Bloom filter generations contain:").expect("stdout broken?");
+ for generation in &generations {
+ out.write_all(format!(" {}", generation).as_bytes()).expect("stdout broken?");
+ }
out.write_all(format!(
out.write_all(format!(
- "\nCurrent connections open/in progress: {}\n", stats.connection_count).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Connections opened each second: {} (\"c x\" to change to x seconds)\n", store.get_u64(U64Setting::ConnsPerSec)
- ).as_bytes()).expect("stdout broken?");
+ "\n\nCurrent connections open/in progress: {}\n", stats.connection_count).as_bytes()).expect("stdout broken?");
out.write_all(format!(
"Current block count: {}\n", stats.header_count).as_bytes()).expect("stdout broken?");
out.write_all(format!(
"Current block count: {}\n", stats.header_count).as_bytes()).expect("stdout broken?");
@@
-91,8
+96,8
@@
impl Printer {
}
out.write_all(format!(
}
out.write_all(format!(
- "\nBGP Routing Table: {} v4
paths, {} v6
paths\n",
- stats.v4_table_size, stats.v6_table_size).as_bytes()).expect("stdout broken?");
+ "\nBGP Routing Table: {} v4
nets, {} v6 nets, {} max
paths\n",
+ stats.v4_table_size, stats.v6_table_size
, stats.paths
).as_bytes()).expect("stdout broken?");
out.write_all(b"\nCommands:\n").expect("stdout broken?");
out.write_all(b"q: quit\n").expect("stdout broken?");
out.write_all(b"\nCommands:\n").expect("stdout broken?");
out.write_all(b"q: quit\n").expect("stdout broken?");
@@
-126,7
+131,7
@@
impl Printer {
} else {
stats.lines.push_back(line);
}
} else {
stats.lines.push_back(line);
}
- if stats.lines.len() >
75
{
+ if stats.lines.len() >
150
{
stats.lines.pop_front();
}
}
stats.lines.pop_front();
}
}
@@
-138,6
+143,7
@@
impl Printer {
Stat::ConnectionClosed => self.stats.lock().unwrap().connection_count -= 1,
Stat::V4RoutingTableSize(c) => self.stats.lock().unwrap().v4_table_size = c,
Stat::V6RoutingTableSize(c) => self.stats.lock().unwrap().v6_table_size = c,
Stat::ConnectionClosed => self.stats.lock().unwrap().connection_count -= 1,
Stat::V4RoutingTableSize(c) => self.stats.lock().unwrap().v4_table_size = c,
Stat::V6RoutingTableSize(c) => self.stats.lock().unwrap().v6_table_size = c,
+ Stat::RoutingTablePaths(c) => self.stats.lock().unwrap().paths = c,
}
}
}
}
}
}