mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
core/region_processor: reenable stat output
This commit is contained in:
parent
506631a18f
commit
fba9b6cb55
1 changed files with 21 additions and 6 deletions
|
@ -230,6 +230,8 @@ impl<'a> RegionProcessor<'a> {
|
||||||
info!("Processing region files...");
|
info!("Processing region files...");
|
||||||
|
|
||||||
let (region_send, region_recv) = mpsc::channel();
|
let (region_send, region_recv) = mpsc::channel();
|
||||||
|
let (processed_send, processed_recv) = mpsc::channel();
|
||||||
|
let (error_send, error_recv) = mpsc::channel();
|
||||||
|
|
||||||
self.collect_regions()?.par_iter().try_for_each(|&coords| {
|
self.collect_regions()?.par_iter().try_for_each(|&coords| {
|
||||||
let ret = self
|
let ret = self
|
||||||
|
@ -240,18 +242,31 @@ impl<'a> RegionProcessor<'a> {
|
||||||
region_send.send(coords).unwrap();
|
region_send.send(coords).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
match ret {
|
||||||
|
RegionProcessorStatus::Ok => processed_send.send(()).unwrap(),
|
||||||
|
RegionProcessorStatus::Skipped => {}
|
||||||
|
RegionProcessorStatus::ErrorOk | RegionProcessorStatus::ErrorMissing => {
|
||||||
|
error_send.send(()).unwrap()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
anyhow::Ok(())
|
anyhow::Ok(())
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
drop(region_send);
|
drop(region_send);
|
||||||
let mut regions: Vec<_> = region_recv.into_iter().collect();
|
let mut regions: Vec<_> = region_recv.into_iter().collect();
|
||||||
|
|
||||||
// info!(
|
drop(processed_send);
|
||||||
// "Processed region files ({} processed, {} unchanged, {} errors)",
|
let processed = processed_recv.into_iter().count();
|
||||||
// processed,
|
drop(error_send);
|
||||||
// results.len() - processed,
|
let errors = error_recv.into_iter().count();
|
||||||
// errors,
|
|
||||||
// );
|
info!(
|
||||||
|
"Processed region files ({} processed, {} unchanged, {} errors)",
|
||||||
|
processed,
|
||||||
|
regions.len() - processed - errors,
|
||||||
|
errors,
|
||||||
|
);
|
||||||
|
|
||||||
// Sort regions in a zig-zag pattern to optimize cache usage
|
// Sort regions in a zig-zag pattern to optimize cache usage
|
||||||
regions.sort_unstable_by_key(|&TileCoords { x, z }| (x, if x % 2 == 0 { z } else { -z }));
|
regions.sort_unstable_by_key(|&TileCoords { x, z }| (x, if x % 2 == 0 { z } else { -z }));
|
||||||
|
|
Loading…
Add table
Reference in a new issue