Skip to content

Commit c80075a

Browse files
committed
- Add scan elapsed time information
- Update for 0.1.3 release
1 parent 4a23c1a commit c80075a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "findlargedir"
3-
version = "0.1.0"
3+
version = "0.1.3"
44
authors = ["Dinko Korunic <[email protected]>"]
55
categories = ["command-line-utilities"]
66
description = "find all blackhole directories with a huge amount of filesystem entries in a flat structure"
@@ -20,6 +20,7 @@ spinach = "2.1.0"
2020
anyhow = "1.0.65"
2121
human_format = "1.0.3"
2222
human_bytes = { version = "0.3.1", features = ["fast"] }
23+
humantime = "2.1.0"
2324
clap = { version = "3.2.22", features = ["derive"] }
2425
ctrlc = { version = "3.2.3", features = ["termination"] }
2526
rm_rf = "0.6.2"

src/main.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ mod walk;
77
use anyhow::{Context, Error, Result};
88
use clap::Parser;
99
use fs_err as fs;
10+
use humantime::Duration;
1011
use std::collections::HashSet;
1112
use std::os::unix::fs::MetadataExt;
1213
use std::sync::atomic::AtomicBool;
1314
use std::sync::Arc;
15+
use std::time::Instant;
1416
use tempfile::TempDir;
1517
use tikv_jemallocator::Jemalloc;
1618

@@ -68,6 +70,8 @@ fn main() -> Result<(), Error> {
6870

6971
println!("Scanning filesystem path {} started", path.display());
7072

73+
let start = Instant::now();
74+
7175
walk::parallel_search(
7276
&path,
7377
path_metadata,
@@ -76,7 +80,11 @@ fn main() -> Result<(), Error> {
7680
&args,
7781
);
7882

79-
println!("Scanning filesystem path {} completed", path.display());
83+
println!(
84+
"Scanning filesystem path {} completed. Time elapsed: {}",
85+
path.display(),
86+
Duration::from(start.elapsed())
87+
);
8088
}
8189

8290
Ok(())

0 commit comments

Comments
 (0)