v.23.8Improvement

Add PartsLockMicroseconds Profile Event to MergeTree Table Engine

Add profile event PartsLockMicroseconds which shows the amount of microseconds we hold the data parts lock in MergeTree table engine family. #53797 (alesapin).
Added a new profile event PartsLockMicroseconds that measures the time in microseconds during which the data parts lock is held in the MergeTree table engine family.

Why it matters

This feature enables users to monitor and analyze the duration for which data parts locks are held in MergeTree tables, helping to diagnose performance bottlenecks related to locking and improve concurrency management.

How to use it

The PartsLockMicroseconds event is automatically captured as part of the profile events when using MergeTree family tables. Users can query this information through profiling tools or system tables that expose profile events to assess lock durations.