Add statistics tracking the amount of time threads spend waiting for the dhandle list lock and possibly other high level locks in WiredTiger.
Specific lock acquire counts might also be interesting. The full set of locks I think are worth considering are:
- Checkpoint lock (WT_CONNECTION::checkpoint_lock)
- Handle list lock (WT_CONNECTION::dhandle_lock)
- Metadata lock (WT_CONNECTION::metadata_lock)
- Schema lock (WT_CONNECTION::schema_lock)
- Table lock (WT_CONNECTION::table_lock)
I'm inclined to add a pair of statistics for each lock type, similar to:
It would also be interesting to distinguish between internal and application threads, but that would lead to a lot of new statistics.
These statistics would be gathered as part of fast statistics, though we want to be careful re: adding gettime calls around lock acquisition. If these locks are acquired regularly it may be worthwhile not gathering the stats for performance reasons.