-
Notifications
You must be signed in to change notification settings - Fork 208
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
base: main
Are you sure you want to change the base?
add query timing #1370
Conversation
@@ -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(); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
This is my first time contributing to the project, if i made some mistake please guide me.