Example - Add progress to insert printing
This commit is contained in:
parent
2d5c5e9061
commit
97f5ef8fa8
1 changed files with 6 additions and 3 deletions
|
@ -29,15 +29,18 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
let total_chunks = 32;
|
||||
let chunk_size = 1024 * 8;
|
||||
|
||||
for _ in 0..total_chunks {
|
||||
for i in 0..total_chunks {
|
||||
let vectors = (0..chunk_size)
|
||||
.map(|_| thread_rng().gen::<[f32; 7]>().into())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
tracing::info!("Inserting vectors");
|
||||
tracing::info!("Inserting vectors {i}/{total_chunks}");
|
||||
let now = Instant::now();
|
||||
db.insert_vectors_blocking(vectors)?;
|
||||
tracing::info!("Inserting vectors - Took {:?}", now.elapsed());
|
||||
tracing::info!(
|
||||
"Inserting vectors {i}/{total_chunks} - Took {:?}",
|
||||
now.elapsed()
|
||||
);
|
||||
}
|
||||
|
||||
let existing_vector: Vector<7> = thread_rng().gen::<[f32; 7]>().into();
|
||||
|
|
Loading…
Reference in a new issue