X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fprinter.rs;h=0bea277e8d4f688bb345580ca398a52b5e0083f7;hb=9640749bafef6edbe18540c2ce4bc1d5bea80a17;hp=c7e902358009a935565211ad62cd57823f7b7652;hpb=57c102899aedc4ee5d20df939cfc3d5266815b65;p=dnsseed-rust diff --git a/src/printer.rs b/src/printer.rs index c7e9023..0bea277 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -51,7 +51,7 @@ impl Printer { out.write_all(b"\nNode counts by status:\n").expect("stdout broken?"); for i in 0..AddressState::get_count() { - out.write_all(format!("{}: {}\n", AddressState::from_num(i).unwrap().to_str(), + out.write_all(format!("{:22}: {}\n", AddressState::from_num(i).unwrap().to_str(), store.get_node_count(AddressState::from_num(i).unwrap()) ).as_bytes()).expect("stdout broken?"); } @@ -76,9 +76,10 @@ impl Printer { out.write_all(b"\nRetry times (in seconds):\n").expect("stdout broken?"); for i in 0..AddressState::get_count() { + let scan_secs = store.get_u64(U64Setting::RescanInterval(AddressState::from_num(i).unwrap())); out.write_all(format!( - "{} ({}): {}\n", AddressState::from_num(i).unwrap().to_str(), i, - store.get_u64(U64Setting::RescanInterval(AddressState::from_num(i).unwrap())) + "{:22} ({:2}): {:5} (ie {} hrs, {} min)\n", AddressState::from_num(i).unwrap().to_str(), i, + scan_secs, scan_secs / 60 / 60, (scan_secs / 60) % 60, ).as_bytes()).expect("stdout broken?"); } @@ -92,6 +93,7 @@ impl Printer { store.get_u64(U64Setting::WasGoodTimeout) ).as_bytes()).expect("stdout broken?"); out.write_all(b"a x: Scan node x\n").expect("stdout broken?"); + out.write_all(b"b x: BGP Lookup IP x\n").expect("stdout broken?"); out.write_all(b"\x1b[s").expect("stdout broken?"); // Save cursor position and provide a blank line before cursor out.write_all(b"\x1b[;H\x1b[2K").expect("stdout broken?"); out.write_all(b"Most recent log:\n").expect("stdout broken?"); @@ -112,7 +114,7 @@ impl Printer { } else { stats.lines.push_back(line); } - if stats.lines.len() > 50 { + if stats.lines.len() > 75 { stats.lines.pop_front(); } }