Commit 7492adb1 authored by Steven Murray's avatar Steven Murray
Browse files

Moved Timer from castor::tape::utils to castor::utils

I believe the Timer class is generic enough to be used by any
part of CASTOR and not just tape.
parent 11868453
......@@ -202,6 +202,7 @@ set (CLIENT_LIB_SRC_FILES
utils/DebugBuf.cpp
utils/SmartFd.cpp
utils/SmartFILEPtr.cpp
utils/Timer.cpp
utils/utils.cpp
vdqm/ClientIdentification.cpp
vdqm/TapeDrive.cpp
......
......@@ -36,11 +36,11 @@
#include "castor/tape/tapegateway/TapeGatewayDlfMessageConstants.hpp"
#include "castor/stager/TapeTpModeCodes.hpp"
#include "castor/tape/utils/Timer.hpp"
#include "castor/tape/tapegateway/daemon/ITapeGatewaySvc.hpp"
#include "castor/tape/tapegateway/daemon/VdqmRequestsCheckerThread.hpp"
#include "castor/tape/tapegateway/daemon/VdqmTapeGatewayHelper.hpp"
#include "castor/tape/tapegateway/daemon/VmgrTapeGatewayHelper.hpp"
#include "castor/utils/Timer.hpp"
//------------------------------------------------------------------------------
......@@ -66,7 +66,7 @@ void castor::tape::tapegateway::VdqmRequestsCheckerThread::run(void*)
// get list of ongoing recall and migration requests
std::list<castor::tape::tapegateway::ITapeGatewaySvc::TapeRequest> requests;
castor::tape::utils::Timer timer;
castor::utils::Timer timer;
try {
// get tapes to check from the db
castor::dlf::dlf_writep(nullCuuid, DLF_LVL_DEBUG,CHECKER_GETTING_TAPES, 0, NULL);
......
......@@ -37,7 +37,6 @@
#include "castor/exception/Exception.hpp"
#include "castor/tape/utils/Timer.hpp"
#include "castor/tape/tapegateway/TapeGatewayDlfMessageConstants.hpp"
#include "castor/tape/tapegateway/EndNotificationErrorReport.hpp"
......@@ -48,6 +47,8 @@
#include "castor/tape/tapegateway/ScopedTransaction.hpp"
#include "castor/utils/Timer.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
......@@ -93,7 +94,7 @@ bool castor::tape::tapegateway::VdqmRequestsProducerThread::getTapeToHandle
int &vdqmPriority,
int &mode)
throw() {
castor::tape::utils::Timer timer;
castor::utils::Timer timer;
try {
// get a tape from the db
castor::dlf::dlf_writep(nullCuuid, DLF_LVL_DEBUG, PRODUCER_GETTING_TAPE, 0, NULL);
......@@ -134,7 +135,7 @@ castor::tape::tapegateway::VdqmRequestsProducerThread::checkInVMGR
const std::string &vid,
const int mode)
throw() {
castor::tape::utils::Timer timer;
castor::utils::Timer timer;
try {
TapeInfo info = VmgrTapeGatewayHelper::getTapeInfoAssertAvailable(vid, m_shuttingDown);
castor::dlf::Param paramsVmgr[] = {
......@@ -190,7 +191,7 @@ void castor::tape::tapegateway::VdqmRequestsProducerThread::sendToVDQM
const int vdqmPriority)
throw() {
VdqmTapeGatewayHelper vdqmHelper;
castor::tape::utils::Timer timer;
castor::utils::Timer timer;
int mountTransactionId = 0;
try {
// connect to vdqm and submit the request
......
......@@ -75,7 +75,7 @@
#include "castor/tape/tapegateway/daemon/WorkerThread.hpp"
#include "castor/tape/utils/utils.hpp"
#include "castor/tape/utils/Timer.hpp"
#include "castor/utils/Timer.hpp"
//------------------------------------------------------------------------------
......@@ -257,7 +257,7 @@ castor::IObject* castor::tape::tapegateway::WorkerThread::handleStartWorker(
castor::dlf::dlf_writep(nullCuuid, DLF_LVL_DEBUG, WORKER_GETTING_VOLUME, params);
castor::tape::utils::Timer timer;
castor::utils::Timer timer;
try {
// GET FROM DB
......@@ -362,7 +362,7 @@ castor::IObject* castor::tape::tapegateway::WorkerThread::handleEndWorker(
}
response->setMountTransactionId(endRequest.mountTransactionId());
response->setAggregatorTransactionId(endRequest.aggregatorTransactionId());
castor::tape::utils::Timer timer;
castor::utils::Timer timer;
try {
// ACCESS DB to get tape to release
castor::tape::tapegateway::ITapeGatewaySvc::TapeToReleaseInfo tape;
......@@ -505,7 +505,7 @@ castor::IObject* castor::tape::tapegateway::WorkerThread::handleFailWorker(
WORKER_FAIL_NOTIFICATION, params);
response->setMountTransactionId(endRequest.mountTransactionId());
response->setAggregatorTransactionId(endRequest.aggregatorTransactionId());
castor::tape::utils::Timer timer;
castor::utils::Timer timer;
try {
// ACCESS DB to get tape to release
castor::tape::tapegateway::ITapeGatewaySvc::TapeToReleaseInfo tape;
......@@ -777,7 +777,7 @@ castor::IObject* castor::tape::tapegateway::WorkerThread::handleFileMigrationRe
}
// 2.3 Update the VMGR for fseq. Stop here in case of failure.
castor::tape::utils::Timer timer;
castor::utils::Timer timer;
try {
VmgrTapeGatewayHelper::bulkUpdateTapeInVmgr(
fileMigrationReportList.successfulMigrations().size(),
......@@ -968,7 +968,7 @@ castor::IObject* castor::tape::tapegateway::WorkerThread::handleFilesToMigrateL
std::queue <FileToMigrateStruct> files_list;
bool dbFailure = false;
double dbServingTime;
castor::tape::utils::Timer timer;
castor::utils::Timer timer;
// Transmit the request to the DB directly
try {
......@@ -1095,7 +1095,7 @@ castor::IObject* castor::tape::tapegateway::WorkerThread::handleFilesToRecallLi
std::queue <castor::tape::tapegateway::ITapeGatewaySvc::FileToRecallStructWithContext> files_list;
bool dbFailure = false;
double dbServingTime;
castor::tape::utils::Timer timer;
castor::utils::Timer timer;
// Transmit the request to the DB directly
try {
......
......@@ -35,8 +35,9 @@
#include "castor/tape/tapegateway/FilesToRecallListRequest.hpp"
#include "castor/tape/tapegateway/FilesToRecallList.hpp"
#include "castor/tape/tapegateway/FileRecallReportList.hpp"
#include "castor/tape/utils/Timer.hpp"
#include "castor/tape/utils/utils.hpp"
#include "castor/utils/Timer.hpp"
#include <cxxabi.h>
#include <memory>
#include <stdlib.h>
......@@ -76,7 +77,7 @@ tapegateway::GatewayMessage *
RequestReport & report)
{
// 0) Start the stopwatch
castor::tape::utils::Timer timer;
castor::utils::Timer timer;
// 1) We re-open connection to client for each request-response exchange
castor::io::ClientSocket clientConnection(m_request.clientPort,
m_request.clientHost);
......
......@@ -212,7 +212,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
// 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)
utils::Timer timer;
castor::utils::Timer timer;
if (rti.synchronousInjection()) {
// We got something to recall. Time to start the machinery
trst.setWaitForInstructionsTime(timer.secs());
......@@ -301,7 +301,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
m_castorConf.bulkRequestMigrationMaxBytes,
m_castorConf.bulkRequestMigrationMaxFiles,lc);
drtp.setTaskInjector(&mti);
utils::Timer timer;
castor::utils::Timer timer;
if (mti.synchronousInjection()) {
const uint64_t firstFseqFromClient = mti.firstFseqToWrite();
......
......@@ -21,9 +21,9 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include "castor/tape/tapeserver/daemon/DiskReadTask.hpp"
#include "castor/tape/utils/Timer.hpp"
#include "castor/log/LogContext.hpp"
#include "castor/tape/tapeserver/daemon/DiskReadTask.hpp"
#include "castor/utils/Timer.hpp"
namespace castor {
namespace tape {
......@@ -47,7 +47,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
using log::LogContext;
using log::Param;
utils::Timer localTime;
castor::utils::Timer localTime;
size_t blockId=0;
size_t migratingFileSize=m_migratedFile->fileSize();
MemBlock* mb=NULL;
......@@ -67,7 +67,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
"and the real one");
}
m_stats.openingTime+=localTime.secs(utils::Timer::resetCounter);
m_stats.openingTime+=localTime.secs(castor::utils::Timer::resetCounter);
LogContext::ScopedParam sp(lc, Param("filePath",m_migratedFile->path()));
lc.log(LOG_INFO,"Opened disk file for read");
......@@ -77,14 +77,14 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
checkMigrationFailing();
mb = m_nextTask.getFreeBlock();
m_stats.waitFreeMemoryTime+=localTime.secs(utils::Timer::resetCounter);
m_stats.waitFreeMemoryTime+=localTime.secs(castor::utils::Timer::resetCounter);
//set metadata and read the data
mb->m_fileid = m_migratedFile->fileid();
mb->m_fileBlock = blockId++;
migratingFileSize -= mb->m_payload.read(*sourceFile);
m_stats.transferTime+=localTime.secs(utils::Timer::resetCounter);
m_stats.transferTime+=localTime.secs(castor::utils::Timer::resetCounter);
m_stats.dataVolume += mb->m_payload.size();
......@@ -95,7 +95,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
mb->markAsFailed(erroMsg,SEINTERNAL);
throw castor::exception::Exception(erroMsg);
}
m_stats.checkingErrorTime += localTime.secs(utils::Timer::resetCounter);
m_stats.checkingErrorTime += localTime.secs(castor::utils::Timer::resetCounter);
// We are done with the block, push it to the write task
m_nextTask.pushDataBlock(mb);
......
......@@ -150,11 +150,11 @@ void DiskReadThreadPool::DiskReadWorkerThread::run() {
m_lc.log(LOG_DEBUG, "DiskReadWorkerThread Running");
std::auto_ptr<DiskReadTask> task;
utils::Timer localTime;
castor::utils::Timer localTime;
while(1) {
task.reset( m_parent.popAndRequestMore(m_lc));
m_threadStat.waitInstructionsTime += localTime.secs(utils::Timer::resetCounter);
m_threadStat.waitInstructionsTime += localTime.secs(castor::utils::Timer::resetCounter);
if (NULL!=task.get()) {
task->execute(m_lc, m_parent.m_diskFileFactory);
m_threadStat += task->getTaskStats();
......
......@@ -21,11 +21,11 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include "castor/log/LogContext.hpp"
#include "castor/tape/tapeserver/daemon/DiskWriteTask.hpp"
#include "castor/tape/tapeserver/daemon/AutoReleaseBlock.hpp"
#include "castor/tape/tapeserver/daemon/MemBlock.hpp"
#include "castor/log/LogContext.hpp"
#include "castor/tape/utils/Timer.hpp"
#include "castor/utils/Timer.hpp"
namespace castor {
namespace tape {
......@@ -47,7 +47,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
diskFile::DiskFileFactory & fileFactory) {
using log::LogContext;
using log::Param;
utils::Timer localTime;
castor::utils::Timer localTime;
try{
std::auto_ptr<tape::diskFile::WriteFile> writeFile(
fileFactory.createWriteFile(m_recallingFile->path()));
......@@ -55,13 +55,13 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
URLcontext.add("actualURL", writeFile->URL())
.add("path", m_recallingFile->path());
lc.log(LOG_INFO, "Opened disk file for write");
m_stats.openingTime+=localTime.secs(utils::Timer::resetCounter);
m_stats.openingTime+=localTime.secs(castor::utils::Timer::resetCounter);
int blockId = 0;
unsigned long checksum = Payload::zeroAdler32();
while(1) {
if(MemBlock* const mb = m_fifo.pop()) {
m_stats.waitDataTime+=localTime.secs(utils::Timer::resetCounter);
m_stats.waitDataTime+=localTime.secs(castor::utils::Timer::resetCounter);
AutoReleaseBlock<RecallMemoryManager> releaser(mb,m_memManager);
if(mb->isCanceled()) {
// If the tape side got canceled, we report nothing and count
......@@ -72,15 +72,15 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
//will throw (thus exiting the loop) if something is wrong
checkErrors(mb,blockId,lc);
m_stats.checkingErrorTime += localTime.secs(utils::Timer::resetCounter);
m_stats.checkingErrorTime += localTime.secs(castor::utils::Timer::resetCounter);
m_stats.dataVolume+=mb->m_payload.size();
mb->m_payload.write(*writeFile);
m_stats.transferTime+=localTime.secs(utils::Timer::resetCounter);
m_stats.transferTime+=localTime.secs(castor::utils::Timer::resetCounter);
checksum = mb->m_payload.adler32(checksum);
m_stats.checksumingTime+=localTime.secs(utils::Timer::resetCounter);
m_stats.checksumingTime+=localTime.secs(castor::utils::Timer::resetCounter);
blockId++;
} //end if block non NULL
......@@ -89,13 +89,13 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
//A close is done in WriteFile's destructor, but it may lead to some
//silent data loss
writeFile->close();
m_stats.closingTime +=localTime.secs(utils::Timer::resetCounter);
m_stats.closingTime +=localTime.secs(castor::utils::Timer::resetCounter);
m_stats.filesCount++;
break;
}
} //end of while(1)
reporter.reportCompletedJob(*m_recallingFile,checksum,m_stats.dataVolume);
m_stats.waitReportingTime+=localTime.secs(utils::Timer::resetCounter);
m_stats.waitReportingTime+=localTime.secs(castor::utils::Timer::resetCounter);
logWithStat(LOG_DEBUG, "File successfully transfered to disk",lc);
//everything went well, return true
......@@ -115,7 +115,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
releaseAllBlock();
reporter.reportFailedJob(*m_recallingFile,e.getMessageValue(),e.code());
m_stats.waitReportingTime+=localTime.secs(utils::Timer::resetCounter);
m_stats.waitReportingTime+=localTime.secs(castor::utils::Timer::resetCounter);
//got an exception, return false
return false;
......
......@@ -20,12 +20,15 @@
*
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include "castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp"
#include "castor/common/CastorConfiguration.hpp"
#include "castor/tape/utils/Timer.hpp"
#include "log.h"
#include "castor/utils/Timer.hpp"
#include "h/log.h"
#include <memory>
#include <sstream>
namespace castor {
namespace tape {
namespace tapeserver {
......@@ -143,11 +146,11 @@ void DiskWriteThreadPool::DiskWriteWorkerThread::run() {
m_lc.log(LOG_INFO, "Starting DiskWriteWorkerThread");
std::auto_ptr<DiskWriteTask> task;
utils::Timer localTime;
castor::utils::Timer localTime;
while(1) {
task.reset(m_parentThreadPool.m_tasks.pop());
m_threadStat.waitInstructionsTime+=localTime.secs(utils::Timer::resetCounter);
m_threadStat.waitInstructionsTime+=localTime.secs(castor::utils::Timer::resetCounter);
if (NULL!=task.get()) {
if(false==task->execute(m_parentThreadPool.m_reporter,m_lc,
m_parentThreadPool.m_diskFileFactory)) {
......
......@@ -49,7 +49,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean
m_this.m_taskInjector->finish();
//then we log/notify
m_this.m_logContext.log(LOG_DEBUG, "Starting session cleanup. Signaled end of session to task injector.");
m_this.m_stats.waitReportingTime += m_timer.secs(utils::Timer::resetCounter);
m_this.m_stats.waitReportingTime += m_timer.secs(castor::utils::Timer::resetCounter);
try {
// Do the final cleanup
// in the special case of a "manual" mode tape, we should skip the unload too.
......@@ -59,16 +59,16 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean
} else {
m_this.m_logContext.log(LOG_INFO, "TapeReadSingleThread: Tape NOT unloaded (manual mode)");
}
m_this.m_stats.unloadTime += m_timer.secs(utils::Timer::resetCounter);
m_this.m_stats.unloadTime += m_timer.secs(castor::utils::Timer::resetCounter);
// And return the tape to the library
// In case of manual mode, this will be filtered by the rmc daemon
// (which will do nothing)
m_this.m_mc.dismountTape(m_this.m_volInfo.vid, m_this.m_drive.librarySlot.str());
m_this.m_stats.unmountTime += m_timer.secs(utils::Timer::resetCounter);
m_this.m_stats.unmountTime += m_timer.secs(castor::utils::Timer::resetCounter);
m_this.m_logContext.log(LOG_INFO, mediachanger::TAPE_LIBRARY_TYPE_MANUAL != m_this.m_drive.librarySlot.getLibraryType() ?
"TapeReadSingleThread : tape unmounted":"TapeReadSingleThread : tape NOT unmounted (manual mode)");
m_this.m_initialProcess.tapeUnmounted();
m_this.m_stats.waitReportingTime += m_timer.secs(utils::Timer::resetCounter);
m_this.m_stats.waitReportingTime += m_timer.secs(castor::utils::Timer::resetCounter);
} catch(const castor::exception::Exception& ex){
// Something failed during the cleaning
m_this.m_hardwareStatus = Session::MARK_DRIVE_AS_DOWN;
......@@ -130,7 +130,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::openReadSession() {
//------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
m_logContext.pushOrReplace(log::Param("thread", "tapeRead"));
castor::tape::utils::Timer timer, totalTimer;
castor::utils::Timer timer, totalTimer;
try{
// Set capabilities allowing rawio (and hence arbitrary SCSI commands)
// through the st driver file descriptor.
......@@ -145,7 +145,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
// Before anything, the tape should be mounted
mountTapeReadOnly();
waitForDrive();
m_stats.mountTime += timer.secs(utils::Timer::resetCounter);
m_stats.mountTime += timer.secs(castor::utils::Timer::resetCounter);
{
castor::log::ScopedParamContainer scoped(m_logContext);
scoped.addTiming("mountTime", m_stats.mountTime);
......@@ -153,7 +153,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
}
// Then we have to initialise the tape read session
std::auto_ptr<castor::tape::tapeFile::ReadSession> rs(openReadSession());
m_stats.positionTime += timer.secs(utils::Timer::resetCounter);
m_stats.positionTime += timer.secs(castor::utils::Timer::resetCounter);
//and then report
{
castor::log::ScopedParamContainer scoped(m_logContext);
......@@ -161,14 +161,14 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
m_logContext.log(LOG_INFO, "Tape read session session successfully started");
}
m_initialProcess.tapeMountedForRead();
m_stats.waitReportingTime += timer.secs(utils::Timer::resetCounter);
m_stats.waitReportingTime += timer.secs(castor::utils::Timer::resetCounter);
// Then we will loop on the tasks as they get from
// the task injector
std::auto_ptr<TapeReadTask> task;
while(true) {
//get a task
task.reset(popAndRequestMoreJobs());
m_stats.waitInstructionsTime += timer.secs(utils::Timer::resetCounter);
m_stats.waitInstructionsTime += timer.secs(castor::utils::Timer::resetCounter);
// If we reached the end
if (NULL==task.get()) {
m_logContext.log(LOG_DEBUG, "No more files to read from tape");
......
......@@ -33,7 +33,7 @@
#include "castor/tape/tapeserver/daemon/TapeServerReporter.hpp"
#include "castor/tape/tapeserver/client/ClientInterface.hpp"
#include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp"
#include "castor/tape/utils/Timer.hpp"
#include "castor/utils/Timer.hpp"
#include <iostream>
#include <memory>
......@@ -79,9 +79,9 @@ private:
class TapeCleaning{
TapeReadSingleThread& m_this;
// As we are living in the single thread of tape, we can borrow the timer
utils::Timer & m_timer;
castor::utils::Timer & m_timer;
public:
TapeCleaning(TapeReadSingleThread& parent, utils::Timer & timer):
TapeCleaning(TapeReadSingleThread& parent, castor::utils::Timer & timer):
m_this(parent), m_timer(timer){}
~TapeCleaning();
};
......
......@@ -31,7 +31,7 @@
#include "castor/tape/tapeserver/daemon/AutoReleaseBlock.hpp"
#include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp"
#include "castor/tape/tapeserver/daemon/TapeSessionStats.hpp"
#include "castor/tape/utils/Timer.hpp"
#include "castor/utils/Timer.hpp"
namespace castor {
namespace tape {
......@@ -62,7 +62,7 @@ public:
*/
void execute(castor::tape::tapeFile::ReadSession & rs,
castor::log::LogContext & lc,RecallWatchDog& watchdog,
TapeSessionStats & stats, utils::Timer & timer) {
TapeSessionStats & stats, castor::utils::Timer & timer) {
using castor::log::Param;
typedef castor::log::LogContext::ScopedParam ScopedParam;
......@@ -77,7 +77,7 @@ public:
// We will clock the stats for the file itself, and eventually add those
// stats to the session's.
TapeSessionStats localStats;
utils::Timer localTime;
castor::utils::Timer localTime;
// Read the file and transmit it
bool stillReading = true;
......@@ -89,13 +89,13 @@ public:
MemBlock* mb=NULL;
try {
std::auto_ptr<castor::tape::tapeFile::ReadFile> rf(openReadFile(rs,lc));
localStats.positionTime += timer.secs(utils::Timer::resetCounter);
localStats.positionTime += timer.secs(castor::utils::Timer::resetCounter);
watchdog.notifyBeginNewJob(*m_fileToRecall);
localStats.waitReportingTime += timer.secs(utils::Timer::resetCounter);
localStats.waitReportingTime += timer.secs(castor::utils::Timer::resetCounter);
while (stillReading) {
// Get a memory block and add information to its metadata
mb=m_mm.getFreeBlock();
localStats.waitFreeMemoryTime += timer.secs(utils::Timer::resetCounter);
localStats.waitFreeMemoryTime += timer.secs(castor::utils::Timer::resetCounter);
mb->m_fSeq = m_fileToRecall->fseq();
mb->m_fileBlock = fileBlock++;
......@@ -114,13 +114,13 @@ public:
// append() signaled the end of the file.
stillReading = false;
}
localStats.transferTime += timer.secs(utils::Timer::resetCounter);
localStats.transferTime += timer.secs(castor::utils::Timer::resetCounter);
localStats.dataVolume += mb->m_payload.size();
// Pass the block to the disk write task
m_fifo.pushDataBlock(mb);
mb=NULL;
watchdog.notify();
localStats.waitReportingTime += timer.secs(utils::Timer::resetCounter);
localStats.waitReportingTime += timer.secs(castor::utils::Timer::resetCounter);
} //end of while(stillReading)
// we have to signal the end of the tape read to the disk write task.
m_fifo.pushDataBlock(NULL);
......
......@@ -37,7 +37,7 @@
#include "castor/tape/tapeserver/daemon/Session.hpp"
#include "castor/tape/tapeserver/daemon/TapeSessionStats.hpp"
#include "castor/tape/tapeserver/drive/DriveInterface.hpp"
#include "castor/tape/utils/Timer.hpp"
#include "castor/utils/Timer.hpp"
namespace castor {
namespace tape {
......@@ -115,7 +115,7 @@ protected:
scoped.add("vid",m_volInfo.vid)
.add("drive_Slot",m_drive.librarySlot.str());
try {
tape::utils::Timer timer;
castor::utils::Timer timer;
m_mc.mountTapeReadOnly(m_volInfo.vid, m_drive.librarySlot.str());
const std::string modeAsString = "R";
scoped.addTiming("MCMountTime",timer.secs()).add("mode",modeAsString);
......@@ -141,7 +141,7 @@ protected:
scoped.add("vid",m_volInfo.vid)
.add("drive_Slot",m_drive.librarySlot.str());
try {
tape::utils::Timer timer;
castor::utils::Timer timer;
m_mc.mountTapeReadWrite(m_volInfo.vid, m_drive.librarySlot.str());
const std::string modeAsString = "RW";
scoped.addTiming("MCMountTime",timer.secs()).add("mode",modeAsString);
......@@ -165,7 +165,7 @@ protected:
*/
void waitForDrive(){
try{
tape::utils::Timer timer;
castor::utils::Timer timer;
// wait 600 drive is ready
m_drive.waitUntilReady(600);
log::LogContext::ScopedParam sp0(m_logContext, log::Param("loadTime", timer.secs()));
......
......@@ -86,10 +86,10 @@ castor::tape::tapeserver::daemon::TapeWriteSingleThread::openWriteSession() {
//------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::TapeWriteSingleThread::
tapeFlush(const std::string& message,uint64_t bytes,uint64_t files,
utils::Timer & timer)
castor::utils::Timer & timer)
{
m_drive.flush();
double flushTime = timer.secs(utils::Timer::resetCounter);
double flushTime = timer.secs(castor::utils::Timer::resetCounter);
log::ScopedParamContainer params(m_logContext);
params.add("files", files)
.add("bytes", bytes)
......@@ -120,7 +120,7 @@ isTapeWritable() const {
//------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
m_logContext.pushOrReplace(log::Param("thread", "TapeWrite"));
castor::tape::utils::Timer timer, totalTimer;
castor::utils::Timer timer, totalTimer;
try
{
// Set capabilities allowing rawio (and hence arbitrary SCSI commands)
......@@ -144,7 +144,7 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
isTapeWritable();
m_stats.mountTime += timer.secs(utils::Timer::resetCounter);
m_stats.mountTime += timer.secs(castor::utils::Timer::resetCounter);
{
castor::log::ScopedParamContainer scoped(m_logContext);
scoped.addTiming("mountTime", m_stats.mountTime);
......@@ -153,7 +153,7 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
// Then we have to initialize the tape write session
std::auto_ptr<castor::tape::tapeFile::WriteSession> writeSession(openWriteSession());
m_stats.positionTime += timer.secs(utils::Timer::resetCounter);
m_stats.positionTime += timer.secs(castor::utils::Timer::resetCounter);
{
castor::log::ScopedParamContainer scoped(m_logContext);
scoped.addTiming("positionTime", m_stats.positionTime);
......@@ -163,18 +163,18 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
m_initialProcess.tapeMountedForWrite();
uint64_t bytes=0;
uint64_t files=0;
m_stats.waitReportingTime += timer.secs(utils::Timer::resetCounter);
m_stats.waitReportingTime += timer.secs(castor::utils::Timer::resetCounter);
std::auto_ptr<TapeWriteTask> task;
while(1) {
//get a task