v.21.6Improvement

Add Metric for Buffer Layer Lock Wait Time Tracking

Add metric to track how much time is spend during waiting for Buffer layer lock. #22725 (Azat Khuzhin).
Added a metric to track the time spent waiting for the Buffer layer lock in ClickHouse.

Why it matters

This feature provides visibility into potential contention or delays caused by locking on the Buffer layer, helping users diagnose performance issues related to write operations and optimize throughput.

How to use it

Users can monitor the newly added metric via ClickHouse's existing metrics interfaces (e.g., system metrics or monitoring tools) to observe and analyze the time spent waiting for the Buffer layer lock.