Commit 0c1d777c authored by David COME's avatar David COME
Browse files

Session stats are now logged aside from TapeWriteTask::execute

parent a6a69183
......@@ -113,30 +113,10 @@ namespace daemon {
localStats.filesCount ++;
reportPacker.reportCompletedJob(*m_fileToMigrate,ckSum);
localStats.waitReportingTime += timer.secs(utils::Timer::resetCounter);
// Log the successful transfer
double fileTime = localTime.secs();
log::ScopedParamContainer params(lc);
params.add("transferTime", localStats.transferTime)
.add("checksumingTime",localStats.checksumingTime)
.add("waitDataTime",localStats.waitDataTime)
.add("waitReportingTime",localStats.waitReportingTime)
.add("dataVolume",localStats.dataVolume)
.add("headerVolume",localStats.headerVolume)
.add("totalTime", fileTime)
.add("driveTransferSpeedMiB/s",
(localStats.dataVolume+localStats.headerVolume)
/1024/1024
/localStats.transferTime)
.add("payloadTransferSpeedMB/s",
1.0*localStats.dataVolume/1024/1024/fileTime)
.add("fileSize",m_fileToMigrate->fileSize())
.add("fileid",m_fileToMigrate->fileid())
.add("fseq",m_fileToMigrate->fseq())
.add("fileTransactionId",m_fileToMigrate->fileTransactionId())
.add("lastKnownFilename",m_fileToMigrate->lastKnownFilename())
.add("lastModificationTime",m_fileToMigrate->lastModificationTime());
lc.log(LOG_INFO, "File successfully transmitted to drive");
// Add the local counts to the session's
// Log the successful transfer
logWithStats(LOG_INFO, "File successfully transmitted to drive",
localTime.secs(),localStats,lc);
// Add the local counts to the session's
stats.add(localStats);
}
catch(const castor::tape::exceptions::ErrorFlag&){
......@@ -256,6 +236,33 @@ namespace daemon {
throw castor::tape::exceptions::ErrorFlag();
}
}
void TapeWriteTask::logWithStats(int level, const std::string& msg,
double fileTime,SessionStats& localStats,log::LogContext& lc) const{
log::ScopedParamContainer params(lc);
params.add("transferTime", localStats.transferTime)
.add("checksumingTime",localStats.checksumingTime)
.add("waitDataTime",localStats.waitDataTime)
.add("waitReportingTime",localStats.waitReportingTime)
.add("dataVolume",localStats.dataVolume)
.add("headerVolume",localStats.headerVolume)
.add("totalTime", fileTime)
.add("driveTransferSpeedMiB/s",
(localStats.dataVolume+localStats.headerVolume)
/1024/1024
/localStats.transferTime)
.add("payloadTransferSpeedMB/s",
1.0*localStats.dataVolume/1024/1024/fileTime)
.add("fileSize",m_fileToMigrate->fileSize())
.add("fileid",m_fileToMigrate->fileid())
.add("fseq",m_fileToMigrate->fseq())
.add("fileTransactionId",m_fileToMigrate->fileTransactionId())
.add("lastKnownFilename",m_fileToMigrate->lastKnownFilename())
.add("lastModificationTime",m_fileToMigrate->lastModificationTime());
lc.log(level, msg);
}
}}}}
......@@ -41,6 +41,7 @@ namespace daemon {
class MigrationReportPacker;
class Memblock;
class SessionStats;
/**
* The TapeWriteFileTask is responsible to write a single file onto tape as part of a migration
* session. Being a consumer of memory blocks, it inherits from the DataConsumer class. It also
......@@ -95,6 +96,13 @@ public:
*/
void circulateMemBlocks();
private:
/**
* Log all localStats' stats + fileTime + m_fileToMigrate's parameters
* into lc with msg at the given level
*/
void logWithStats(int level, const std::string& msg,
double fileTime,SessionStats& localStats,log::LogContext& lc) const;
/**
*Throw an exception if m_errorFlag is set
*/
......
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