mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(storage): log debug commit message only on commit (#6918)
This commit is contained in:
@ -123,12 +123,15 @@ impl<K: TransactionKind> Tx<K> {
|
||||
let (result, commit_latency) = f(tx);
|
||||
let total_duration = start.elapsed();
|
||||
|
||||
debug!(
|
||||
target: "storage::db::mdbx",
|
||||
?total_duration,
|
||||
?commit_latency,
|
||||
"Commit"
|
||||
);
|
||||
if outcome.is_commit() {
|
||||
debug!(
|
||||
target: "storage::db::mdbx",
|
||||
?total_duration,
|
||||
?commit_latency,
|
||||
is_read_only = K::IS_READ_ONLY,
|
||||
"Commit"
|
||||
);
|
||||
}
|
||||
|
||||
(result, commit_latency, total_duration)
|
||||
};
|
||||
|
||||
@ -187,6 +187,11 @@ impl TransactionOutcome {
|
||||
TransactionOutcome::Drop => "drop",
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if the transaction outcome is a commit.
|
||||
pub(crate) const fn is_commit(&self) -> bool {
|
||||
matches!(self, TransactionOutcome::Commit)
|
||||
}
|
||||
}
|
||||
|
||||
/// Types of operations conducted on the database: get, put, delete, and various cursor operations.
|
||||
|
||||
Reference in New Issue
Block a user