Commit dd45743d authored by Eric Cano's avatar Eric Cano
Browse files

Disabled or made conditional some repetitive logs.

parent 2c3bd119
......@@ -192,7 +192,7 @@ void AgentReference::queueAndExecuteAction(std::shared_ptr<Action> action, objec
// and commit
ag.commit();
double agentCommitTime = t.secs(utils::Timer::resetCounter);
if (ownershipModification) {
if (ownershipModification && false) { // Log disabled to not log too much.
log::ScopedParamContainer params(lc);
params.add("agentOwnershipSizeBefore", agentOwnershipSizeBefore)
.add("agentOwnershipSizeAfter", agentOwnershipSizeAfter)
......
......@@ -421,7 +421,8 @@ public:
ret.summary.addDeltaToLog(previousSummary, params);
contSummaryAfter.addDeltaToLog(contSummaryBefore, params);
localTimingList.addToLog(params);
lc.log(log::INFO, "In Algorithms::popNextBatch(): did one round of elements retrieval.");
if (ret.elements.size())
lc.log(log::INFO, "In Algorithms::popNextBatch(): did one round of elements retrieval.");
timingList+=localTimingList;
}
logAndReturn:
......@@ -433,7 +434,8 @@ public:
timingList.addToLog(params);
params.add("schedulerDbTime", totalTime.secs());
params.add("iterationCount", iterationCount);
lc.log(log::INFO, "In Algorithms::popNextBatch(): elements retrieval complete.");
if (ret.elements.size())
lc.log(log::INFO, "In Algorithms::popNextBatch(): elements retrieval complete.");
}
return ret;
}
......
......@@ -37,7 +37,7 @@ void DiskReportRunner::runOnePass(log::LogContext& lc) {
utils::Timer t2, roundTime;
auto archiveJobsToReport = m_scheduler.getNextArchiveJobsToReportBatch(BATCH_SIZE, lc);
{
if (archiveJobsToReport.size()) {
log::ScopedParamContainer params(lc);
params.add("jobsToReport", archiveJobsToReport.size());
lc.log(cta::log::DEBUG,"In DiskReportRunner::runOnePass(): ready to process archive reports.");
......@@ -52,7 +52,7 @@ void DiskReportRunner::runOnePass(log::LogContext& lc) {
}
auto retrieveJobsToReport = m_scheduler.getNextRetrieveJobsToReportBatch(BATCH_SIZE, lc);
{
if (retrieveJobsToReport.size()) {
log::ScopedParamContainer params(lc);
params.add("jobsToReport", retrieveJobsToReport.size());
lc.log(cta::log::DEBUG,"In DiskReportRunner::runOnePass(): ready to process retrieve reports.");
......@@ -67,9 +67,11 @@ void DiskReportRunner::runOnePass(log::LogContext& lc) {
}
}
log::ScopedParamContainer params(lc);
auto passTime = t.secs();
params.add("roundCount", roundCount)
.add("passTime", t.secs());
lc.log(log::INFO, "In DiskReportRunner::runOnePass(): finished one pass.");
.add("passTime", passTime);
if (passTime > 1)
lc.log(log::INFO, "In DiskReportRunner::runOnePass(): finished one pass.");
}
} // namespace cta
......@@ -370,7 +370,8 @@ void OStoreDB::fetchMountInfo(SchedulerDatabase::TapeMountDecisionInfo& tmdi, Ro
log::ScopedParamContainer params (logContext);
params.add("queueFetchTime", registerFetchTime)
.add("processingTime", registerProcessingTime);
logContext.log(log::INFO, "In OStoreDB::fetchMountInfo(): fetched the drive register.");
if ((registerFetchTime > 1) || (registerProcessingTime > 1))
logContext.log(log::INFO, "In OStoreDB::fetchMountInfo(): fetched the drive register.");
}
//------------------------------------------------------------------------------
......@@ -404,7 +405,8 @@ std::unique_ptr<SchedulerDatabase::TapeMountDecisionInfo>
.add("lockSchedGlobalTime", lockSchedGlobalTime)
.add("fetchSchedGlobalTime", fetchSchedGlobalTime)
.add("fetchMountInfoTime", fetchMountInfoTime);
logContext.log(log::INFO, "In OStoreDB::getMountInfo(): success.");
if ((rootFetchNoLockTime > 1) || (lockSchedGlobalTime > 1) || (fetchSchedGlobalTime > 1) || fetchMountInfoTime > 1)
logContext.log(log::INFO, "In OStoreDB::getMountInfo(): success.");
}
return ret;
}
......@@ -429,7 +431,8 @@ std::unique_ptr<SchedulerDatabase::TapeMountDecisionInfo> OStoreDB::getMountInfo
log::ScopedParamContainer params(logContext);
params.add("rootFetchNoLockTime", rootFetchNoLockTime)
.add("fetchMountInfoTime", fetchMountInfoTime);
logContext.log(log::INFO, "In OStoreDB::getMountInfoNoLock(): success.");
if ((rootFetchNoLockTime > 1) || (fetchMountInfoTime > 1))
logContext.log(log::INFO, "In OStoreDB::getMountInfoNoLock(): success.");
}
return ret;
}
......
......@@ -520,7 +520,7 @@ Scheduler::RepackReportBatch Scheduler::getNextRepackReportBatch(log::LogContext
//------------------------------------------------------------------------------
void Scheduler::RepackReportBatch::report(log::LogContext& lc) {
if (nullptr == m_DbBatch) {
lc.log(log::DEBUG, "In Scheduler::RepackReportBatch::report(): empty batch.");
// lc.log(log::DEBUG, "In Scheduler::RepackReportBatch::report(): empty batch.");
} else {
m_DbBatch->report(lc);
}
......@@ -595,10 +595,12 @@ common::dataStructures::DesiredDriveState Scheduler::getDesiredDriveState(const
for (auto & d: driveStates) {
if (d.driveName == driveName) {
auto schedulerDbTime = t.secs();
log::ScopedParamContainer spc(lc);
spc.add("drive", driveName)
.add("schedulerDbTime", schedulerDbTime);
lc.log(log::INFO, "In Scheduler::getDesiredDriveState(): success.");
if (schedulerDbTime > 1) {
log::ScopedParamContainer spc(lc);
spc.add("drive", driveName)
.add("schedulerDbTime", schedulerDbTime);
lc.log(log::INFO, "In Scheduler::getDesiredDriveState(): success.");
}
return d.desiredDriveState;
}
}
......@@ -645,10 +647,12 @@ void Scheduler::reportDriveStatus(const common::dataStructures::DriveInfo& drive
utils::Timer t;
m_db.reportDriveStatus(driveInfo, type, status, time(NULL), lc);
auto schedulerDbTime = t.secs();
log::ScopedParamContainer spc(lc);
spc.add("drive", driveInfo.driveName)
.add("schedulerDbTime", schedulerDbTime);
lc.log(log::INFO, "In Scheduler::reportDriveStatus(): success.");
if (schedulerDbTime > 1) {
log::ScopedParamContainer spc(lc);
spc.add("drive", driveInfo.driveName)
.add("schedulerDbTime", schedulerDbTime);
lc.log(log::INFO, "In Scheduler::reportDriveStatus(): success.");
}
}
//------------------------------------------------------------------------------
......@@ -985,7 +989,9 @@ bool Scheduler::getNextMountDryRun(const std::string& logicalLibraryName, const
.add("decisionTime", decisionTime)
.add("schedulerDbTime", schedulerDbTime)
.add("catalogueTime", catalogueTime);
lc.log(log::DEBUG, "In Scheduler::getNextMountDryRun(): No valid mount found.");
if ((getMountInfoTime > 1) || (getTapeInfoTime > 1) || (candidateSortingTime > 1) || (getTapeForWriteTime > 1) ||
(decisionTime > 1) || (schedulerDbTime > 1) || (catalogueTime > 1))
lc.log(log::DEBUG, "In Scheduler::getNextMountDryRun(): No valid mount found.");
return false;
}
......
......@@ -313,7 +313,7 @@ int MaintenanceHandler::runChild() {
do {
utils::Timer t;
m_processManager.logContext().log(log::DEBUG,
"In MaintenanceHandler::runChild(): About to run a GC pass.");
"In MaintenanceHandler::runChild(): About to do a maintenance pass.");
gc.runOnePass(m_processManager.logContext());
diskReportRunner.runOnePass(m_processManager.logContext());
repackRequestManager.runOnePass(m_processManager.logContext());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment