From 38ffb990e87717dfad596da608beecdbf94871f5 Mon Sep 17 00:00:00 2001 From: Bulat-Ziganshin Date: Thu, 8 Sep 2022 05:02:17 +0300 Subject: [PATCH] Print time of every SQLiteStore operation --- codex/stores/sqlitestore.nim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/codex/stores/sqlitestore.nim b/codex/stores/sqlitestore.nim index 7dae2e6c..393fe20f 100644 --- a/codex/stores/sqlitestore.nim +++ b/codex/stores/sqlitestore.nim @@ -75,6 +75,8 @@ method getBlock*( ## Save a copy to the cache if present in the database but not in the cache ## + notice " == getBlock" + if not self.cache.isNil: trace "Getting block from cache or database", cid else: @@ -191,6 +193,7 @@ method hasBlock*( ## Check if a block exists in the database ## + notice " == hasBlock" trace "Checking database for block existence", cid if cid.isEmpty: @@ -234,6 +237,8 @@ method listBlocks*( ## This is an intensive operation ## + notice "== List started ==" + for id in self.listBlocksQuery(): let # keys stored in id column of SQLiteDatastore are serialized Key @@ -245,6 +250,8 @@ method listBlocks*( else: trace "Unable to construct CID from key", key = id, error = $cidRes.error + notice "== List finished" + return success() method close*(self: SQLiteStore): Future[void] {.async.} =