Commit 482f44eb authored by Victor Kotlyar's avatar Victor Kotlyar
Browse files

Deleted castor::utils::Timer

parent aa629531
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "castor/tape/tapeserver/daemon/DriveConfig.hpp" #include "castor/tape/tapeserver/daemon/DriveConfig.hpp"
#include "castor/tape/tapeserver/daemon/ProcessForkerProxy.hpp" #include "castor/tape/tapeserver/daemon/ProcessForkerProxy.hpp"
#include "castor/tape/tapeserver/system/Wrapper.hpp" #include "castor/tape/tapeserver/system/Wrapper.hpp"
#include "castor/utils/Timer.hpp" #include "common/Timer.hpp"
#include <iostream> #include <iostream>
#include <memory> #include <memory>
...@@ -362,7 +362,7 @@ private: ...@@ -362,7 +362,7 @@ private:
* Timer used to decide when to check if another transfer session needs to * Timer used to decide when to check if another transfer session needs to
* be launched. * be launched.
*/ */
castor::utils::Timer m_launchTransferSessionTimer; cta::utils::Timer m_launchTransferSessionTimer;
/** /**
* Checks that there is a tape session currently associated with the * Checks that there is a tape session currently associated with the
......
...@@ -171,7 +171,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction ...@@ -171,7 +171,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
// We are now ready to put everything in motion. First step is to check // We are now ready to put everything in motion. First step is to check
// we get any concrete job to be done from the client (via the task injector) // we get any concrete job to be done from the client (via the task injector)
castor::utils::Timer timer; cta::utils::Timer timer;
if (rti.synchronousInjection()) { //adapt the recall task injector (starting from synchronousInjection) if (rti.synchronousInjection()) { //adapt the recall task injector (starting from synchronousInjection)
// We got something to recall. Time to start the machinery // We got something to recall. Time to start the machinery
trst.setWaitForInstructionsTime(timer.secs()); trst.setWaitForInstructionsTime(timer.secs());
...@@ -260,7 +260,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction ...@@ -260,7 +260,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
drtp.setTaskInjector(&mti); drtp.setTaskInjector(&mti);
twst.setTaskInjector(&mti); twst.setTaskInjector(&mti);
mrp.setWatchdog(mwd); mrp.setWatchdog(mwd);
castor::utils::Timer timer; cta::utils::Timer timer;
if (mti.synchronousInjection()) { if (mti.synchronousInjection()) {
const uint64_t firstFseqFromClient = mti.firstFseqToWrite(); const uint64_t firstFseqFromClient = mti.firstFseqToWrite();
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "castor/log/LogContext.hpp" #include "castor/log/LogContext.hpp"
#include "castor/tape/tapeserver/daemon/DiskReadTask.hpp" #include "castor/tape/tapeserver/daemon/DiskReadTask.hpp"
#include "castor/utils/Timer.hpp" #include "common/Timer.hpp"
namespace castor { namespace castor {
namespace tape { namespace tape {
...@@ -51,8 +51,8 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file ...@@ -51,8 +51,8 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
using log::LogContext; using log::LogContext;
using log::Param; using log::Param;
castor::utils::Timer localTime; cta::utils::Timer localTime;
castor::utils::Timer totalTime(localTime); cta::utils::Timer totalTime(localTime);
size_t blockId=0; size_t blockId=0;
size_t migratingFileSize=m_archiveJob->archiveFile.fileSize; size_t migratingFileSize=m_archiveJob->archiveFile.fileSize;
MemBlock* mb=NULL; MemBlock* mb=NULL;
...@@ -79,7 +79,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file ...@@ -79,7 +79,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
} }
currentErrorToCount = ""; currentErrorToCount = "";
m_stats.openingTime+=localTime.secs(castor::utils::Timer::resetCounter); m_stats.openingTime+=localTime.secs(cta::utils::Timer::resetCounter);
LogContext::ScopedParam sp(lc, Param("fileId",m_archiveJob->archiveFile.archiveFileID)); LogContext::ScopedParam sp(lc, Param("fileId",m_archiveJob->archiveFile.archiveFileID));
lc.log(LOG_INFO,"Opened disk file for read"); lc.log(LOG_INFO,"Opened disk file for read");
...@@ -89,7 +89,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file ...@@ -89,7 +89,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
checkMigrationFailing(); checkMigrationFailing();
mb = m_nextTask.getFreeBlock(); mb = m_nextTask.getFreeBlock();
m_stats.waitFreeMemoryTime+=localTime.secs(castor::utils::Timer::resetCounter); m_stats.waitFreeMemoryTime+=localTime.secs(cta::utils::Timer::resetCounter);
//set metadata and read the data //set metadata and read the data
mb->m_fileid = m_archiveJob->archiveFile.archiveFileID; mb->m_fileid = m_archiveJob->archiveFile.archiveFileID;
...@@ -97,7 +97,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file ...@@ -97,7 +97,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
currentErrorToCount = "Error_diskRead"; currentErrorToCount = "Error_diskRead";
migratingFileSize -= mb->m_payload.read(*sourceFile); migratingFileSize -= mb->m_payload.read(*sourceFile);
m_stats.readWriteTime+=localTime.secs(castor::utils::Timer::resetCounter); m_stats.readWriteTime+=localTime.secs(cta::utils::Timer::resetCounter);
m_stats.dataVolume += mb->m_payload.size(); m_stats.dataVolume += mb->m_payload.size();
...@@ -121,7 +121,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file ...@@ -121,7 +121,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
throw cta::exception::Exception(erroMsg); throw cta::exception::Exception(erroMsg);
} }
currentErrorToCount = ""; currentErrorToCount = "";
m_stats.checkingErrorTime += localTime.secs(castor::utils::Timer::resetCounter); m_stats.checkingErrorTime += localTime.secs(cta::utils::Timer::resetCounter);
// We are done with the block, push it to the write task // We are done with the block, push it to the write task
m_nextTask.pushDataBlock(mb); m_nextTask.pushDataBlock(mb);
......
...@@ -159,12 +159,12 @@ void DiskReadThreadPool::DiskReadWorkerThread::run() { ...@@ -159,12 +159,12 @@ void DiskReadThreadPool::DiskReadWorkerThread::run() {
m_lc.log(LOG_DEBUG, "Starting DiskReadWorkerThread"); m_lc.log(LOG_DEBUG, "Starting DiskReadWorkerThread");
std::unique_ptr<DiskReadTask> task; std::unique_ptr<DiskReadTask> task;
castor::utils::Timer localTime; cta::utils::Timer localTime;
castor::utils::Timer totalTime; cta::utils::Timer totalTime;
while(1) { while(1) {
task.reset( m_parent.popAndRequestMore(m_lc)); task.reset( m_parent.popAndRequestMore(m_lc));
m_threadStat.waitInstructionsTime += localTime.secs(castor::utils::Timer::resetCounter); m_threadStat.waitInstructionsTime += localTime.secs(cta::utils::Timer::resetCounter);
if (NULL!=task.get()) { if (NULL!=task.get()) {
task->execute(m_lc, m_parent.m_diskFileFactory,m_parent.m_watchdog); task->execute(m_lc, m_parent.m_diskFileFactory,m_parent.m_watchdog);
m_threadStat += task->getTaskStats(); m_threadStat += task->getTaskStats();
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "common/threading/Threading.hpp" #include "common/threading/Threading.hpp"
#include "common/threading/AtomicCounter.hpp" #include "common/threading/AtomicCounter.hpp"
#include "castor/log/LogContext.hpp" #include "castor/log/LogContext.hpp"
#include "castor/utils/Timer.hpp" #include "common/Timer.hpp"
#include <vector> #include <vector>
#include <stdint.h> #include <stdint.h>
...@@ -137,7 +137,7 @@ private: ...@@ -137,7 +137,7 @@ private:
/** /**
* Measure the thread pool's lifetime * Measure the thread pool's lifetime
*/ */
castor::utils::Timer m_totalTime; cta::utils::Timer m_totalTime;
/** /**
* A disk file factory, that will create the proper type of file access class, * A disk file factory, that will create the proper type of file access class,
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "castor/tape/tapeserver/daemon/DiskWriteTask.hpp" #include "castor/tape/tapeserver/daemon/DiskWriteTask.hpp"
#include "castor/tape/tapeserver/daemon/AutoReleaseBlock.hpp" #include "castor/tape/tapeserver/daemon/AutoReleaseBlock.hpp"
#include "castor/tape/tapeserver/daemon/MemBlock.hpp" #include "castor/tape/tapeserver/daemon/MemBlock.hpp"
#include "castor/utils/Timer.hpp" #include "common/Timer.hpp"
namespace castor { namespace castor {
namespace tape { namespace tape {
...@@ -47,9 +47,9 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc, ...@@ -47,9 +47,9 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
diskFile::DiskFileFactory & fileFactory, RecallWatchDog & watchdog) { diskFile::DiskFileFactory & fileFactory, RecallWatchDog & watchdog) {
using log::LogContext; using log::LogContext;
using log::Param; using log::Param;
castor::utils::Timer localTime; cta::utils::Timer localTime;
castor::utils::Timer totalTime(localTime); cta::utils::Timer totalTime(localTime);
castor::utils::Timer transferTime(localTime); cta::utils::Timer transferTime(localTime);
log::ScopedParamContainer URLcontext(lc); log::ScopedParamContainer URLcontext(lc);
URLcontext.add("archiveFileID",m_retrieveJob->retrieveRequest.archiveFileID) URLcontext.add("archiveFileID",m_retrieveJob->retrieveRequest.archiveFileID)
.add("dstURL", m_retrieveJob->retrieveRequest.dstURL) .add("dstURL", m_retrieveJob->retrieveRequest.dstURL)
...@@ -69,7 +69,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc, ...@@ -69,7 +69,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
unsigned long checksum = Payload::zeroAdler32(); unsigned long checksum = Payload::zeroAdler32();
while(1) { while(1) {
if(MemBlock* const mb = m_fifo.pop()) { if(MemBlock* const mb = m_fifo.pop()) {
m_stats.waitDataTime+=localTime.secs(castor::utils::Timer::resetCounter); m_stats.waitDataTime+=localTime.secs(cta::utils::Timer::resetCounter);
AutoReleaseBlock<RecallMemoryManager> releaser(mb,m_memManager); AutoReleaseBlock<RecallMemoryManager> releaser(mb,m_memManager);
if(mb->isCanceled()) { if(mb->isCanceled()) {
// If the tape side got canceled, we report nothing and count // If the tape side got canceled, we report nothing and count
...@@ -80,7 +80,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc, ...@@ -80,7 +80,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
//will throw (thus exiting the loop) if something is wrong //will throw (thus exiting the loop) if something is wrong
checkErrors(mb,blockId,lc); checkErrors(mb,blockId,lc);
m_stats.checkingErrorTime += localTime.secs(castor::utils::Timer::resetCounter); m_stats.checkingErrorTime += localTime.secs(cta::utils::Timer::resetCounter);
// If we got that far on the first pass, it's now good enough to open // If we got that far on the first pass, it's now good enough to open
// the disk file for writing... // the disk file for writing...
if (!writeFile.get()) { if (!writeFile.get()) {
...@@ -91,17 +91,17 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc, ...@@ -91,17 +91,17 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
writeFile.reset(fileFactory.createWriteFile(m_retrieveJob->retrieveRequest.dstURL)); writeFile.reset(fileFactory.createWriteFile(m_retrieveJob->retrieveRequest.dstURL));
URLcontext.add("actualURL", writeFile->URL()); URLcontext.add("actualURL", writeFile->URL());
lc.log(LOG_INFO, "Opened disk file for writing"); lc.log(LOG_INFO, "Opened disk file for writing");
m_stats.openingTime+=localTime.secs(castor::utils::Timer::resetCounter); m_stats.openingTime+=localTime.secs(cta::utils::Timer::resetCounter);
} }
// Write the data. // Write the data.
currentErrorToCount = "Error_diskWrite"; currentErrorToCount = "Error_diskWrite";
m_stats.dataVolume+=mb->m_payload.size(); m_stats.dataVolume+=mb->m_payload.size();
mb->m_payload.write(*writeFile); mb->m_payload.write(*writeFile);
m_stats.readWriteTime+=localTime.secs(castor::utils::Timer::resetCounter); m_stats.readWriteTime+=localTime.secs(cta::utils::Timer::resetCounter);
checksum = mb->m_payload.adler32(checksum); checksum = mb->m_payload.adler32(checksum);
m_stats.checksumingTime+=localTime.secs(castor::utils::Timer::resetCounter); m_stats.checksumingTime+=localTime.secs(cta::utils::Timer::resetCounter);
currentErrorToCount = ""; currentErrorToCount = "";
blockId++; blockId++;
...@@ -112,7 +112,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc, ...@@ -112,7 +112,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
//silent data loss //silent data loss
currentErrorToCount = "Error_diskCloseAfterWrite"; currentErrorToCount = "Error_diskCloseAfterWrite";
writeFile->close(); writeFile->close();
m_stats.closingTime +=localTime.secs(castor::utils::Timer::resetCounter); m_stats.closingTime +=localTime.secs(cta::utils::Timer::resetCounter);
m_stats.filesCount++; m_stats.filesCount++;
break; break;
currentErrorToCount = ""; currentErrorToCount = "";
...@@ -127,7 +127,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc, ...@@ -127,7 +127,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
m_retrieveJob->transferredChecksumValue = cs.str(); m_retrieveJob->transferredChecksumValue = cs.str();
} }
reporter.reportCompletedJob(std::move(m_retrieveJob)); reporter.reportCompletedJob(std::move(m_retrieveJob));
m_stats.waitReportingTime+=localTime.secs(castor::utils::Timer::resetCounter); m_stats.waitReportingTime+=localTime.secs(cta::utils::Timer::resetCounter);
m_stats.transferTime = transferTime.secs(); m_stats.transferTime = transferTime.secs();
m_stats.totalTime = totalTime.secs(); m_stats.totalTime = totalTime.secs();
...@@ -152,7 +152,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc, ...@@ -152,7 +152,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
watchdog.addToErrorCount(currentErrorToCount); watchdog.addToErrorCount(currentErrorToCount);
} }
m_stats.waitReportingTime+=localTime.secs(castor::utils::Timer::resetCounter); m_stats.waitReportingTime+=localTime.secs(cta::utils::Timer::resetCounter);
log::ScopedParamContainer params(lc); log::ScopedParamContainer params(lc);
params.add("errorMessage", e.getMessageValue()); params.add("errorMessage", e.getMessageValue());
logWithStat(LOG_ERR, "File writing to disk failed.", lc); logWithStat(LOG_ERR, "File writing to disk failed.", lc);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp" #include "castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp"
#include "castor/common/CastorConfiguration.hpp" #include "castor/common/CastorConfiguration.hpp"
#include "castor/utils/Timer.hpp" #include "common/Timer.hpp"
#include "castor/log/LogContext.hpp" #include "castor/log/LogContext.hpp"
#include <memory> #include <memory>
...@@ -153,12 +153,12 @@ void DiskWriteThreadPool::DiskWriteWorkerThread::run() { ...@@ -153,12 +153,12 @@ void DiskWriteThreadPool::DiskWriteWorkerThread::run() {
m_lc.log(LOG_INFO, "Starting DiskWriteWorkerThread"); m_lc.log(LOG_INFO, "Starting DiskWriteWorkerThread");
std::unique_ptr<DiskWriteTask> task; std::unique_ptr<DiskWriteTask> task;
castor::utils::Timer localTime; cta::utils::Timer localTime;
castor::utils::Timer totalTime(localTime); cta::utils::Timer totalTime(localTime);
while(1) { while(1) {
task.reset(m_parentThreadPool.m_tasks.pop()); task.reset(m_parentThreadPool.m_tasks.pop());
m_threadStat.waitInstructionsTime+=localTime.secs(castor::utils::Timer::resetCounter); m_threadStat.waitInstructionsTime+=localTime.secs(cta::utils::Timer::resetCounter);
if (NULL!=task.get()) { if (NULL!=task.get()) {
if(false==task->execute(m_parentThreadPool.m_reporter,m_lc, if(false==task->execute(m_parentThreadPool.m_reporter,m_lc,
m_parentThreadPool.m_diskFileFactory, m_parentThreadPool.m_watchdog)) { m_parentThreadPool.m_diskFileFactory, m_parentThreadPool.m_watchdog)) {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "castor/tape/tapeserver/daemon/DiskWriteTask.hpp" #include "castor/tape/tapeserver/daemon/DiskWriteTask.hpp"
#include "castor/tape/tapeserver/daemon/DiskStats.hpp" #include "castor/tape/tapeserver/daemon/DiskStats.hpp"
#include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp" #include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp"
#include "castor/utils/Timer.hpp" #include "common/Timer.hpp"
#include <vector> #include <vector>
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
#include <inttypes.h> #include <inttypes.h>
...@@ -189,7 +189,7 @@ private: ...@@ -189,7 +189,7 @@ private:
/** /**
* Measure the thread pool's lifetime * Measure the thread pool's lifetime
*/ */
castor::utils::Timer m_totalTime; cta::utils::Timer m_totalTime;
/** Reference to the report packer where tasks report the result of their /** Reference to the report packer where tasks report the result of their
* individual files and the end of session (for the last thread) */ * individual files and the end of session (for the last thread) */
......
...@@ -54,7 +54,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean ...@@ -54,7 +54,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean
m_this.m_taskInjector->finish(); m_this.m_taskInjector->finish();
//then we log/notify //then we log/notify
m_this.m_logContext.log(LOG_DEBUG, "Starting session cleanup. Signalled end of session to task injector."); m_this.m_logContext.log(LOG_DEBUG, "Starting session cleanup. Signalled end of session to task injector.");
m_this.m_stats.waitReportingTime += m_timer.secs(castor::utils::Timer::resetCounter); m_this.m_stats.waitReportingTime += m_timer.secs(cta::utils::Timer::resetCounter);
// Log (safely, exception-wise) the tape alerts (if any) at the end of the session // Log (safely, exception-wise) the tape alerts (if any) at the end of the session
try { m_this.logTapeAlerts(); } catch (...) {} try { m_this.logTapeAlerts(); } catch (...) {}
// This out-of-try-catch variables allows us to record the stage of the // This out-of-try-catch variables allows us to record the stage of the
...@@ -83,7 +83,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean ...@@ -83,7 +83,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean
} else { } else {
m_this.m_logContext.log(LOG_INFO, "TapeReadSingleThread: Tape NOT unloaded (manual mode)"); m_this.m_logContext.log(LOG_INFO, "TapeReadSingleThread: Tape NOT unloaded (manual mode)");
} }
m_this.m_stats.unloadTime += m_timer.secs(castor::utils::Timer::resetCounter); m_this.m_stats.unloadTime += m_timer.secs(cta::utils::Timer::resetCounter);
// And return the tape to the library // And return the tape to the library
// In case of manual mode, this will be filtered by the rmc daemon // In case of manual mode, this will be filtered by the rmc daemon
// (which will do nothing) // (which will do nothing)
...@@ -92,11 +92,11 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean ...@@ -92,11 +92,11 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean
m_this.m_mc.dismountTape(m_this.m_volInfo.vid, m_this.m_drive.config.getLibrarySlot()); m_this.m_mc.dismountTape(m_this.m_volInfo.vid, m_this.m_drive.config.getLibrarySlot());
m_this.m_drive.disableLogicalBlockProtection(); m_this.m_drive.disableLogicalBlockProtection();
m_this.m_rrp.reportDriveStatus(cta::common::DriveStatus::Up); m_this.m_rrp.reportDriveStatus(cta::common::DriveStatus::Up);
m_this.m_stats.unmountTime += m_timer.secs(castor::utils::Timer::resetCounter); m_this.m_stats.unmountTime += m_timer.secs(cta::utils::Timer::resetCounter);
m_this.m_logContext.log(LOG_INFO, mediachanger::TAPE_LIBRARY_TYPE_MANUAL != m_this.m_drive.config.getLibrarySlot().getLibraryType() ? m_this.m_logContext.log(LOG_INFO, mediachanger::TAPE_LIBRARY_TYPE_MANUAL != m_this.m_drive.config.getLibrarySlot().getLibraryType() ?
"TapeReadSingleThread : tape unmounted":"TapeReadSingleThread : tape NOT unmounted (manual mode)"); "TapeReadSingleThread : tape unmounted":"TapeReadSingleThread : tape NOT unmounted (manual mode)");
m_this.m_initialProcess.reportTapeUnmountedForRetrieve(); m_this.m_initialProcess.reportTapeUnmountedForRetrieve();
m_this.m_stats.waitReportingTime += m_timer.secs(castor::utils::Timer::resetCounter); m_this.m_stats.waitReportingTime += m_timer.secs(cta::utils::Timer::resetCounter);
} catch(const cta::exception::Exception& ex){ } catch(const cta::exception::Exception& ex){
// Something failed during the cleaning // Something failed during the cleaning
m_this.m_hardwareStatus = Session::MARK_DRIVE_AS_DOWN; m_this.m_hardwareStatus = Session::MARK_DRIVE_AS_DOWN;
...@@ -181,7 +181,7 @@ const char *castor::tape::tapeserver::daemon::TapeReadSingleThread:: ...@@ -181,7 +181,7 @@ const char *castor::tape::tapeserver::daemon::TapeReadSingleThread::
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() { void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
m_logContext.pushOrReplace(log::Param("thread", "TapeRead")); m_logContext.pushOrReplace(log::Param("thread", "TapeRead"));
castor::utils::Timer timer, totalTimer; cta::utils::Timer timer, totalTimer;
std::string currentErrorToCount = "Error_setCapabilities"; std::string currentErrorToCount = "Error_setCapabilities";
try{ try{
// Set capabilities allowing rawio (and hence arbitrary SCSI commands) // Set capabilities allowing rawio (and hence arbitrary SCSI commands)
...@@ -211,7 +211,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() { ...@@ -211,7 +211,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
waitForDrive(); waitForDrive();
currentErrorToCount = "Error_checkingTapeAlert"; currentErrorToCount = "Error_checkingTapeAlert";
logTapeAlerts(); logTapeAlerts();
m_stats.mountTime += timer.secs(castor::utils::Timer::resetCounter); m_stats.mountTime += timer.secs(cta::utils::Timer::resetCounter);
{ {
castor::log::ScopedParamContainer scoped(m_logContext); castor::log::ScopedParamContainer scoped(m_logContext);
scoped.add("mountTime", m_stats.mountTime); scoped.add("mountTime", m_stats.mountTime);
...@@ -222,7 +222,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() { ...@@ -222,7 +222,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
std::unique_ptr<castor::tape::tapeFile::ReadSession> rs(openReadSession()); std::unique_ptr<castor::tape::tapeFile::ReadSession> rs(openReadSession());
// From now on, the tasks will identify problems when executed. // From now on, the tasks will identify problems when executed.
currentErrorToCount = ""; currentErrorToCount = "";
m_stats.positionTime += timer.secs(castor::utils::Timer::resetCounter); m_stats.positionTime += timer.secs(cta::utils::Timer::resetCounter);
//and then report //and then report
{ {
castor::log::ScopedParamContainer scoped(m_logContext); castor::log::ScopedParamContainer scoped(m_logContext);
...@@ -249,7 +249,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() { ...@@ -249,7 +249,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
} }
m_initialProcess.reportState(cta::tape::session::SessionState::Running, m_initialProcess.reportState(cta::tape::session::SessionState::Running,
cta::tape::session::SessionType::Retrieve); cta::tape::session::SessionType::Retrieve);
m_stats.waitReportingTime += timer.secs(castor::utils::Timer::resetCounter); m_stats.waitReportingTime += timer.secs(cta::utils::Timer::resetCounter);
// Then we will loop on the tasks as they get from // Then we will loop on the tasks as they get from
// the task injector // the task injector
std::unique_ptr<TapeReadTask> task; std::unique_ptr<TapeReadTask> task;
...@@ -257,7 +257,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() { ...@@ -257,7 +257,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
while(true) { while(true) {
//get a task //get a task
task.reset(popAndRequestMoreJobs()); task.reset(popAndRequestMoreJobs());
m_stats.waitInstructionsTime += timer.secs(castor::utils::Timer::resetCounter); m_stats.waitInstructionsTime += timer.secs(cta::utils::Timer::resetCounter);
// If we reached the end // If we reached the end
if (NULL==task.get()) { if (NULL==task.get()) {
m_logContext.log(LOG_DEBUG, "No more files to read from tape"); m_logContext.log(LOG_DEBUG, "No more files to read from tape");
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include "castor/tape/tapeserver/daemon/TapeServerReporter.hpp" #include "castor/tape/tapeserver/daemon/TapeServerReporter.hpp"
#include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp" #include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp"
#include "castor/tape/tapeserver/daemon/VolumeInfo.hpp" #include "castor/tape/tapeserver/daemon/VolumeInfo.hpp"
#include "castor/utils/Timer.hpp" #include "common/Timer.hpp"
#include <iostream> #include <iostream>
#include <memory> #include <memory>
...@@ -89,9 +89,9 @@ private: ...@@ -89,9 +89,9 @@ private:
class TapeCleaning{ class TapeCleaning{
TapeReadSingleThread& m_this; TapeReadSingleThread& m_this;
// As we are living in the single thread of tape, we can borrow the timer // As we are living in the single thread of tape, we can borrow the timer
castor::utils::Timer & m_timer; cta::utils::Timer & m_timer;
public: public:
TapeCleaning(TapeReadSingleThread& parent, castor::utils::Timer & timer): TapeCleaning(TapeReadSingleThread& parent, cta::utils::Timer & timer):
m_this(parent), m_timer(timer){} m_this(parent), m_timer(timer){}
~TapeCleaning(); ~TapeCleaning();
}; };
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "castor/tape/tapeserver/daemon/AutoReleaseBlock.hpp" #include "castor/tape/tapeserver/daemon/AutoReleaseBlock.hpp"
#include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp" #include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp"
#include "castor/tape/tapeserver/daemon/TapeSessionStats.hpp" #include "castor/tape/tapeserver/daemon/TapeSessionStats.hpp"
#include "castor/utils/Timer.hpp" #include "common/Timer.hpp"
#include "common/exception/Exception.hpp" #include "common/exception/Exception.hpp"
namespace castor { namespace castor {
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
*/ */
void execute(castor::tape::tapeFile::ReadSession & rs, void execute(castor::tape::tapeFile::ReadSession & rs,
castor::log::LogContext & lc,RecallWatchDog& watchdog, castor::log::LogContext & lc,RecallWatchDog& watchdog,
TapeSessionStats & stats, castor::utils::Timer & timer) { TapeSessionStats & stats, cta::utils::Timer & timer) {
using castor::log::Param; using castor::log::Param;
...@@ -77,8 +77,8 @@ public: ...@@ -77,8 +77,8 @@ public:
// stats to the session's. // stats to the session's.
TapeSessionStats localStats; TapeSessionStats localStats;
std::string LBPMode; std::string LBPMode;
castor::utils::Timer localTime; cta::utils::Timer localTime;
castor::utils::Timer totalTime(localTime); cta::utils::Timer totalTime(localTime);
// Read the file and transmit it // Read the file and transmit it
bool stillReading = true; bool stillReading