/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2009 Oracle. All rights reserved. * */ using System; using System.Collections.Generic; using System.Text; namespace BerkeleyDB { /// /// Statistical information about the locking subsystem /// public class LockStats { private Internal.LockStatStruct st; internal LockStats(Internal.LockStatStruct stats) { st = stats; } /// /// Last allocated locker ID. /// public uint LastAllocatedLockerID { get { return st.st_id; } } /// /// Lock conflicts w/ subsequent wait /// public ulong LockConflictsWait { get { return st.st_lock_wait; } } /// /// Lock conflicts w/o subsequent wait /// public ulong LockConflictsNoWait { get { return st.st_lock_nowait; } } /// /// Number of lock deadlocks. /// public ulong LockDeadlocks { get { return st.st_ndeadlocks; } } /// /// Number of lock downgrades. /// public ulong LockDowngrades { get { return st.st_ndowngrade; } } /// /// Number of lock modes. /// public int LockModes { get { return st.st_nmodes; } } /// /// Number of lock puts. /// public ulong LockPuts { get { return st.st_nreleases; } } /// /// Number of lock gets. /// public ulong LockRequests { get { return st.st_nrequests; } } /// /// Number of lock steals so far. /// public ulong LockSteals { get { return st.st_locksteals; } } /// /// Lock timeout. /// public uint LockTimeoutLength { get { return st.st_locktimeout; } } /// /// Number of lock timeouts. /// public ulong LockTimeouts { get { return st.st_nlocktimeouts; } } /// /// Number of lock upgrades. /// public ulong LockUpgrades { get { return st.st_nupgrade; } } /// /// Locker lock granted without wait. /// public ulong LockerNoWait { get { return st.st_lockers_nowait; } } /// /// Locker lock granted after wait. /// public ulong LockerWait { get { return st.st_lockers_wait; } } /// /// Current number of lockers. /// public uint Lockers { get { return st.st_nlockers; } } /// /// Current number of locks. /// public uint Locks { get { return st.st_nlocks; } } /// /// Max length of bucket. /// public uint MaxBucketLength { get { return st.st_hash_len; } } /// /// Maximum number steals in any partition. /// public ulong MaxLockSteals { get { return st.st_maxlsteals; } } /// /// Maximum number of lockers so far. /// public uint MaxLockers { get { return st.st_maxnlockers; } } /// /// Maximum num of lockers in table. /// public uint MaxLockersInTable { get { return st.st_maxlockers; } } /// /// Maximum number of locks so far. /// public uint MaxLocks { get { return st.st_maxnlocks; } } /// /// Maximum number of locks in any bucket. /// public uint MaxLocksInBucket { get { return st.st_maxhlocks; } } /// /// Maximum number of locks in table. /// public uint MaxLocksInTable { get { return st.st_maxlocks; } } /// /// Maximum number of steals in any partition. /// public ulong MaxObjectSteals { get { return st.st_maxosteals; } } /// /// Maximum number of objects so far. /// public uint MaxObjects { get { return st.st_maxnobjects; } } /// /// Maximum number of objectsin any bucket. /// public uint MaxObjectsInBucket { get { return st.st_maxhobjects; } } /// /// Max partition lock granted without wait. /// public ulong MaxPartitionLockNoWait { get { return st.st_part_max_nowait; } } /// /// Max partition lock granted after wait. /// public ulong MaxPartitionLockWait { get { return st.st_part_max_wait; } } /// /// Current maximum unused ID. /// public uint MaxUnusedID { get { return st.st_cur_maxid; } } /// /// Maximum num of objects in table. /// public uint MaxObjectsInTable { get { return st.st_maxobjects; } } /// /// number of partitions. /// public uint nPartitions { get { return st.st_partitions; } } /// /// Object lock granted without wait. /// public ulong ObjectNoWait { get { return st.st_objs_nowait; } } /// /// Number of objects steals so far. /// public ulong ObjectSteals { get { return st.st_objectsteals; } } /// /// Object lock granted after wait. /// public ulong ObjectWait { get { return st.st_objs_wait; } } /// /// Current number of objects. /// public uint Objects { get { return st.st_nobjects; } } /// /// Partition lock granted without wait. /// public ulong PartitionLockNoWait { get { return st.st_part_nowait; } } /// /// Partition lock granted after wait. /// public ulong PartitionLockWait { get { return st.st_part_wait; } } /// /// Region lock granted without wait. /// public ulong RegionNoWait { get { return st.st_region_nowait; } } /// /// Region size. /// public ulong RegionSize { get { return (ulong)st.st_regsize.ToInt64(); } } /// /// Region lock granted after wait. /// public ulong RegionWait { get { return st.st_region_wait; } } /// /// Transaction timeout. /// public uint TxnTimeoutLength { get { return st.st_txntimeout; } } /// /// Number of transaction timeouts. /// public ulong TxnTimeouts { get { return st.st_ntxntimeouts; } } } }