Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add query timing #1370

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

add query timing #1370

wants to merge 1 commit into from

Conversation

ajayvish0
Copy link

This is my first time contributing to the project, if i made some mistake please guide me.

@@ -446,7 +446,7 @@ pub unsafe extern "C" fn libsql_execute_stmt(
set_err_msg(format!("Error executing statement: {}", e), out_err_msg);
2
}
}
}let end_time = start_time.elapsed();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will compile.

let conn = conn.get_ref();
match RT.block_on(conn.query(sql, ())) {
Ok(rows) => {
let end_time = start_time.elapsed(); // Calculate elapsed time
println!("Query execution time: {:?}", end_time);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bad practise to print like that in libraries. Please use tracing instead.

let rows = Box::leak(Box::new(libsql_rows { result: rows }));
*out_rows = libsql_rows_t::from(rows);
}
Err(e) => {
let end_time = start_time.elapsed(); // Calculate elapsed time
println!("Query execution failed. Time elapsed: {:?}", end_time);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bad practise to print like that in libraries. Please use tracing instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants