Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
1. saving meta json file
2. change statistics format
  • Loading branch information
ipconfiger committed Jan 24, 2024
1 parent be5db32 commit 20d9270
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 19 deletions.
219 changes: 211 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ dirs = "3.0.2"
rdkafka = { version = "0.33.2", default-features = false, features = ["cmake-build"] }
redis = { version = "0.23", features = ["tokio-comp"] }
hex = "0.4"
byteorder = "1.4.3"
byteorder = "1.4.3"
chrono = "0.4"
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ fn serve(cfg_path: &String) {
//println!("text result is :{:?}", text_resp);
let (file, pos) = check_valid_pos(posMng.clone(), text_resp, config.from_start.is_some_and(|b|b));
println!("{file} {pos}");
update_name_pos(posMng.clone(), &file, pos);

let dump = ComBinLogDump {
pos,
Expand All @@ -92,7 +93,7 @@ fn serve(cfg_path: &String) {
let mut statistics= Statistics::new();
loop {
let (_, buf) = conn.read_package::<Vec<u8>>().unwrap();
statistics.feed_bytes(buf.payload.len());
statistics.feed_bytes(seq_idx, buf.payload.len());
let event_result = EventRaw::decode(buf.payload.as_bytes());
if let Ok((_, ev)) = event_result {
if ev.header.event_type == 19 {
Expand Down
1 change: 1 addition & 0 deletions src/message_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ fn outgiving_body(rx: Receiver<QueueMessage>, mq_ins: &mut dyn QueueClient, posM
if let Ok(msg) = rx.recv() {
mq_ins.queue_message(&msg);
update_pos(posMng.clone(), msg.pos);
//println!("msg sent!");
}
}
}
Expand Down
Loading

0 comments on commit 20d9270

Please sign in to comment.