mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add PageOps metrics to libmdbx-rs (#5786)
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -9,7 +9,6 @@ target/
|
||||
# MSVC Windows builds of rustc generate these, which store debugging information
|
||||
*.pdb
|
||||
|
||||
|
||||
# Generated by Intellij-based IDEs.
|
||||
.idea
|
||||
|
||||
@ -43,5 +42,8 @@ lcov.info
|
||||
# Generated by ./etc/generate-jwt.sh
|
||||
jwttoken/
|
||||
|
||||
# Cache directory for CCLS, if using it with MDBX sources
|
||||
.ccls-cache/
|
||||
|
||||
# Generated by CMake due to MDBX sources
|
||||
crates/storage/libmdbx-rs/mdbx-sys/libmdbx/cmake-build-debug
|
||||
@ -411,6 +411,25 @@ impl Info {
|
||||
pub fn num_readers(&self) -> usize {
|
||||
self.0.mi_numreaders as usize
|
||||
}
|
||||
|
||||
/// Return the internal page ops metrics
|
||||
#[inline]
|
||||
pub fn page_ops(&self) -> PageOps {
|
||||
PageOps {
|
||||
newly: self.0.mi_pgop_stat.newly,
|
||||
cow: self.0.mi_pgop_stat.cow,
|
||||
clone: self.0.mi_pgop_stat.clone,
|
||||
split: self.0.mi_pgop_stat.split,
|
||||
merge: self.0.mi_pgop_stat.merge,
|
||||
spill: self.0.mi_pgop_stat.spill,
|
||||
unspill: self.0.mi_pgop_stat.unspill,
|
||||
wops: self.0.mi_pgop_stat.wops,
|
||||
prefault: self.0.mi_pgop_stat.prefault,
|
||||
mincore: self.0.mi_pgop_stat.mincore,
|
||||
msync: self.0.mi_pgop_stat.msync,
|
||||
fsync: self.0.mi_pgop_stat.fsync,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Environment {
|
||||
@ -429,6 +448,35 @@ pub enum PageSize {
|
||||
Set(usize),
|
||||
}
|
||||
|
||||
/// Statistics of page operations overall of all (running, completed and aborted) transactions
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct PageOps {
|
||||
/// Quantity of a new pages added
|
||||
pub newly: u64,
|
||||
/// Quantity of pages copied for update
|
||||
pub cow: u64,
|
||||
/// Quantity of parent's dirty pages clones for nested transactions
|
||||
pub clone: u64,
|
||||
/// Page splits
|
||||
pub split: u64,
|
||||
/// Page merges
|
||||
pub merge: u64,
|
||||
/// Quantity of spilled dirty pages
|
||||
pub spill: u64,
|
||||
/// Quantity of unspilled/reloaded pages
|
||||
pub unspill: u64,
|
||||
/// Number of explicit write operations (not a pages) to a disk
|
||||
pub wops: u64,
|
||||
/// Number of explicit msync/flush-to-disk operations
|
||||
pub msync: u64,
|
||||
/// Number of explicit fsync/flush-to-disk operations
|
||||
pub fsync: u64,
|
||||
/// Number of prefault write operations
|
||||
pub prefault: u64,
|
||||
/// Number of mincore() calls
|
||||
pub mincore: u64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct Geometry<R> {
|
||||
pub size: Option<R>,
|
||||
|
||||
Reference in New Issue
Block a user