1
0
Fork 0

MORE Debug logging

This commit is contained in:
Michael Hackstein 2019-07-08 13:01:10 +02:00
parent f0787c87a1
commit 06aabcdfe1
2 changed files with 8 additions and 3 deletions

View File

@ -75,13 +75,16 @@ class SupervisedScheduler final : public Scheduler {
explicit WorkItem(std::function<void()>&& handler)
: _handler(std::move(handler)), _startTime(TRI_microtime()), _called(false) {}
~WorkItem() {
if (!_called && (TRI_microtime() - _startTime) > 0.01) {
if (!_called && (TRI_microtime() - _startTime) > 0.1) {
LOG_TOPIC("hunde", ERR, arangodb::Logger::REPLICATION)
<< "Work item forgotten, created at " << _startTime << " that is "
<< (TRI_microtime() - _startTime) << "s ago.";
}
}
WorkItem(WorkItem const& other) = delete;
WorkItem(WorkItem && other) = default;
void operator()() {
_called = true;
auto waittime = TRI_microtime() - _startTime;

View File

@ -1920,7 +1920,8 @@ OperationResult transaction::Methods::insertLocal(std::string const& collectionN
auto localTime = TRI_microtime() - startTime;
if (localTime > 0.4) {
LOG_TOPIC("hunde", ERR, Logger::REPLICATION)
<< "Local write slow, done after: " << localTime << "s";
<< "Local write slow, done after: " << localTime
<< "s on key: " << value.get(StaticStrings::KeyString).toJson();
}
if (res.ok() && replicationType == ReplicationType::LEADER) {
TRI_ASSERT(collection != nullptr);
@ -1941,7 +1942,8 @@ OperationResult transaction::Methods::insertLocal(std::string const& collectionN
if (TRI_microtime() - startTime > 0.4) {
LOG_TOPIC("hunde", ERR, Logger::REPLICATION)
<< "Replication write slow, done after: " << (TRI_microtime() - startTime)
<< "s local used: " << localTime << "s";
<< "s local used: " << localTime
<< "s on key: " << value.get(StaticStrings::KeyString).toJson();
}
if (options.silent && countErrorCodes.empty()) {
// We needed the results, but do not want to report: