mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-09 16:34:32 -04:00
feat(sqlite): Add timer! tracings in read and write's SqliteEventCacheStore.
This commit is contained in:
@@ -36,6 +36,7 @@ use matrix_sdk_base::{
|
||||
Position, RawChunk, Update,
|
||||
},
|
||||
media::{MediaRequestParameters, UniqueKey},
|
||||
timer,
|
||||
};
|
||||
use matrix_sdk_store_encryption::StoreCipher;
|
||||
use ruma::{
|
||||
@@ -176,11 +177,10 @@ impl SqliteEventCacheStore {
|
||||
#[instrument(skip_all)]
|
||||
async fn read(&self) -> Result<SqliteAsyncConn> {
|
||||
trace!("Taking a `read` connection");
|
||||
let _timer = timer!("connection");
|
||||
|
||||
let connection = self.pool.get().await?;
|
||||
|
||||
trace!("`read` connection taken");
|
||||
|
||||
// Per https://www.sqlite.org/foreignkeys.html#fk_enable, foreign key
|
||||
// support must be enabled on a per-connection basis. Execute it every
|
||||
// time we try to get a connection, since we can't guarantee a previous
|
||||
@@ -194,11 +194,10 @@ impl SqliteEventCacheStore {
|
||||
#[instrument(skip_all)]
|
||||
async fn write(&self) -> Result<OwnedMutexGuard<SqliteAsyncConn>> {
|
||||
trace!("Taking a `write` connection");
|
||||
let _timer = timer!("connection");
|
||||
|
||||
let connection = self.write_connection.clone().lock_owned().await;
|
||||
|
||||
trace!("`write` connection taken");
|
||||
|
||||
// Per https://www.sqlite.org/foreignkeys.html#fk_enable, foreign key
|
||||
// support must be enabled on a per-connection basis. Execute it every
|
||||
// time we try to get a connection, since we can't guarantee a previous
|
||||
|
||||
Reference in New Issue
Block a user