mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Fxi
This commit is contained in:
parent
66ba9e029e
commit
3a289534cb
@ -258,7 +258,8 @@ The server successfully detected this situation and will download merged part fr
|
||||
M(RWLockReadersWaitMilliseconds, "Total time spent waiting for a read lock to be acquired (in a heavy RWLock).") \
|
||||
M(RWLockWritersWaitMilliseconds, "Total time spent waiting for a write lock to be acquired (in a heavy RWLock).") \
|
||||
M(DNSError, "Total count of errors in DNS resolution") \
|
||||
M(PartsLockMicroseconds, "Total time spent holding data parts lock in MergeTree tables") \
|
||||
M(PartsLockHoldMicroseconds, "Total time spent holding data parts lock in MergeTree tables") \
|
||||
M(PartsLockWaitMicroseconds, "Total time spent waiting for data parts lock in MergeTree tables") \
|
||||
\
|
||||
M(RealTimeMicroseconds, "Total (wall clock) time spent in processing (queries and other tasks) threads (note that this is a sum).") \
|
||||
M(UserTimeMicroseconds, "Total time spent in processing (queries and other tasks) threads executing CPU instructions in user mode. This include time CPU pipeline was stalled due to main memory access, cache misses, branch mispredictions, hyper-threading, etc.") \
|
||||
|
@ -128,7 +128,8 @@ namespace ProfileEvents
|
||||
extern const Event RejectedMutations;
|
||||
extern const Event DelayedMutations;
|
||||
extern const Event DelayedMutationsMilliseconds;
|
||||
extern const Event PartsLockMicroseconds;
|
||||
extern const Event PartsLockWaitMicroseconds;
|
||||
extern const Event PartsLockHoldMicroseconds;
|
||||
}
|
||||
|
||||
namespace CurrentMetrics
|
||||
@ -309,11 +310,19 @@ void MergeTreeData::initializeDirectoriesAndFormatVersion(const std::string & re
|
||||
throw Exception(ErrorCodes::METADATA_MISMATCH, "MergeTree data format version on disk doesn't support custom partitioning");
|
||||
}
|
||||
}
|
||||
DataPartsLock::DataPartsLock(std::mutex & data_parts_mutex_)
|
||||
: wait_watch(Stopwatch(CLOCK_MONOTONIC))
|
||||
, lock(data_parts_mutex_)
|
||||
, lock_watch(Stopwatch(CLOCK_MONOTONIC))
|
||||
{
|
||||
ProfileEvents::increment(ProfileEvents::PartsLockWaitMicroseconds, wait_watch->elapsedMicroseconds());
|
||||
}
|
||||
|
||||
|
||||
DataPartsLock::~DataPartsLock()
|
||||
{
|
||||
if (watch.has_value())
|
||||
ProfileEvents::increment(ProfileEvents::PartsLockMicroseconds, watch->elapsedMicroseconds());
|
||||
if (lock_watch.has_value())
|
||||
ProfileEvents::increment(ProfileEvents::PartsLockHoldMicroseconds, lock_watch->elapsedMicroseconds());
|
||||
}
|
||||
|
||||
MergeTreeData::MergeTreeData(
|
||||
|
@ -86,14 +86,11 @@ namespace ErrorCodes
|
||||
|
||||
struct DataPartsLock
|
||||
{
|
||||
std::optional<Stopwatch> wait_watch;
|
||||
std::unique_lock<std::mutex> lock;
|
||||
std::optional<Stopwatch> watch;
|
||||
std::optional<Stopwatch> lock_watch;
|
||||
DataPartsLock() = default;
|
||||
|
||||
explicit DataPartsLock(std::mutex & data_parts_mutex_)
|
||||
: lock(data_parts_mutex_)
|
||||
, watch(Stopwatch(CLOCK_MONOTONIC))
|
||||
{}
|
||||
explicit DataPartsLock(std::mutex & data_parts_mutex_);
|
||||
|
||||
~DataPartsLock();
|
||||
};
|
||||
|
@ -10,7 +10,7 @@ ORDER BY tuple();
|
||||
|
||||
INSERT INTO random_mt VALUES (1, 'Hello');
|
||||
|
||||
SELECT value > 0 from system.events WHERE event = 'PartsLockMicroseconds';
|
||||
SELECT any(value > 0) from system.events WHERE event = 'PartsLockHoldMicroseconds' or event = 'PartsLockWaitMicroseconds';
|
||||
|
||||
DROP TABLE IF EXISTS random_mt;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user