diff --git a/objectstore/AgentReference.cpp b/objectstore/AgentReference.cpp index 961e87e2d5e1ef4b79dfd1c714fd830449cb6761..761328ea59ef439839e27d878b55dc059ebc6b5c 100644 --- a/objectstore/AgentReference.cpp +++ b/objectstore/AgentReference.cpp @@ -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) diff --git a/objectstore/Algorithms.hpp b/objectstore/Algorithms.hpp index af2a67c9352fc44738629808fce0d3001f366804..af76c69c0454e61c7f6122cbdf24bc2bc11f2578 100644 --- a/objectstore/Algorithms.hpp +++ b/objectstore/Algorithms.hpp @@ -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; } diff --git a/scheduler/DiskReportRunner.cpp b/scheduler/DiskReportRunner.cpp index 74095e1c2823b644a11935c0d049249d6323a171..77d7973420d379020456c04b92db190545b1c2e8 100644 --- a/scheduler/DiskReportRunner.cpp +++ b/scheduler/DiskReportRunner.cpp @@ -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 diff --git a/scheduler/OStoreDB/OStoreDB.cpp b/scheduler/OStoreDB/OStoreDB.cpp index 6f1d126e15838c980ff3e0944b85311fa95680c5..c15aa7f309a795dd7d3d311107a58f92bfae74e9 100644 --- a/scheduler/OStoreDB/OStoreDB.cpp +++ b/scheduler/OStoreDB/OStoreDB.cpp @@ -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; } diff --git a/scheduler/Scheduler.cpp b/scheduler/Scheduler.cpp index f2f9b67d2b58e81043a2291455ca7e567798960e..a08f4b739197029e3f2154710f48ed8bb60b0180 100644 --- a/scheduler/Scheduler.cpp +++ b/scheduler/Scheduler.cpp @@ -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; } diff --git a/tapeserver/daemon/MaintenanceHandler.cpp b/tapeserver/daemon/MaintenanceHandler.cpp index 10ea084f4a6b052eb1e39bcc52f082bebc8c9519..d45ae67080aefd3917299a0077416c63431cca1d 100644 --- a/tapeserver/daemon/MaintenanceHandler.cpp +++ b/tapeserver/daemon/MaintenanceHandler.cpp @@ -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());