diff --git a/.github/workflows/publish-cli-docker.yaml b/.github/workflows/publish-cli-docker.yaml index eb25a298..b19350d7 100644 --- a/.github/workflows/publish-cli-docker.yaml +++ b/.github/workflows/publish-cli-docker.yaml @@ -11,7 +11,7 @@ on: type: string description: "CLI version" required: true - default: "0.4.0" + default: "0.5.1" IMAGE_NAME: type: string description: "Container image name to tag" diff --git a/lantern_cli/Cargo.toml b/lantern_cli/Cargo.toml index ae914733..2f54dfb4 100644 --- a/lantern_cli/Cargo.toml +++ b/lantern_cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lantern_cli" -version = "0.5.0" +version = "0.5.1" edition = "2021" [[bin]] diff --git a/lantern_cli/src/embeddings/mod.rs b/lantern_cli/src/embeddings/mod.rs index 2c779232..462c1961 100644 --- a/lantern_cli/src/embeddings/mod.rs +++ b/lantern_cli/src/embeddings/mod.rs @@ -512,6 +512,7 @@ async fn db_exporter_worker( // if job is run in streaming mode // it will write results to target table each 10 seconds (if collected rows are // more than 50) or if collected row count is more than 1000 rows + let copy_start = Instant::now(); if !buf.is_empty() { writer_sink.send(buf.split().freeze()).await?; } @@ -519,6 +520,10 @@ async fn db_exporter_worker( transaction.batch_execute(&update_sql).await?; transaction.commit().await?; transaction = client.transaction().await?; + + let duration = copy_start.elapsed().as_millis(); + logger.debug(&format!("Copied {collected_row_cnt} rows in {duration}ms")); + writer_sink = Box::pin( transaction .copy_in(&format!("COPY {temp_table_name} FROM stdin")) @@ -546,12 +551,15 @@ async fn db_exporter_worker( return Ok(processed_row_cnt); } + let copy_start = Instant::now(); if !buf.is_empty() { writer_sink.send(buf.split().freeze()).await? } writer_sink.as_mut().finish().await?; transaction.batch_execute(&update_sql).await?; transaction.commit().await?; + let duration = copy_start.elapsed().as_millis(); + logger.debug(&format!("Copied {collected_row_cnt} rows in {duration}ms")); logger.info(&format!( "Embeddings exported to table {} under column {}", &table, &column