mirror of
https://github.com/facebook/sapling.git
synced 2024-12-31 00:53:47 +03:00
add a debug log message reporting how long PeriodicTasks took
Summary: Add a debug log message at the end of each PeriodicTask iteration, reporting how long the task took. Reviewed By: wez Differential Revision: D15798504 fbshipit-source-id: 3f33877cb4a9ddb8d966877b005e6d4c60d7dbe0
This commit is contained in:
parent
aa45fa2cb7
commit
69dc2be426
@ -43,6 +43,11 @@ void PeriodicTask::timeoutExpired() noexcept {
|
||||
// Since these run on the main EventBase thread we want to ensure that they
|
||||
// don't block this thread for long periods of time.
|
||||
auto duration = timer.elapsed();
|
||||
XLOG(DBG6) << "ran periodic task " << name_ << " in "
|
||||
<< (std::chrono::duration_cast<std::chrono::microseconds>(duration)
|
||||
.count() /
|
||||
1000.0)
|
||||
<< "ms";
|
||||
if (duration > kSlowTaskLimit) {
|
||||
// Just in case some task starts frequently running slowly for some reason,
|
||||
// put some rate limiting on this log message.
|
||||
|
Loading…
Reference in New Issue
Block a user