Skip to content

Commit 533f109

Browse files
authored
Merge pull request #2672 from Expensify/dsilva_logOnlySlowQueries
Only log read only queries if they take more than 100ms
2 parents 7c4911b + 326c729 commit 533f109

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sqlitecluster/SQLite.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,8 @@ bool SQLite::read(const string& query, const map<string, Parameter>& params, SQR
658658
_readElapsed += timeSpent;
659659

660660
// If we're not inside a transaction, this doesn't get added to our normal transaction timing.
661-
if (!_insideTransaction) {
661+
// This log line will happen a lot. Let's log only when it takes more than 100ms to complete.
662+
if (!_insideTransaction && _readElapsed > 100'000) {
662663
SINFO("Read with auto-transaction timing info", {
663664
{"totalTransactionElapsed", to_string(timeSpent / 1000)},
664665
});

0 commit comments

Comments
 (0)