-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
73 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use super::*; | ||
|
||
pub(crate) fn run() -> Result { | ||
let database = unsafe { Database::open("index.redb")? }; | ||
|
||
let stats = database.stats()?; | ||
|
||
println!("tree height: {}", stats.tree_height()); | ||
println!("free pages: {}", stats.free_pages()); | ||
println!("stored bytes: {}", stats.stored_bytes()); | ||
println!("overhead bytes: {}", stats.overhead_bytes()); | ||
println!("fragmented bytes: {}", stats.fragmented_bytes()); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use super::*; | ||
|
||
#[test] | ||
fn basic() -> Result { | ||
let output = Test::new()?.command("index").block().output()?; | ||
|
||
Test::with_tempdir(output.tempdir) | ||
.command("info") | ||
.stdout_regex( | ||
r" | ||
tree height: \d+ | ||
free pages: \d+ | ||
stored bytes: \d+ | ||
overhead bytes: \d+ | ||
fragmented bytes: \d+ | ||
" | ||
.unindent(), | ||
) | ||
.run() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters