Commit 64be1e6b authored by Eric Cano's avatar Eric Cano
Browse files

Homogenized the log parameters for fileId.

parent 355b9953
......@@ -32,12 +32,12 @@ namespace unitTests {
ASSERT_EQ(1U, lc.size());
{
// Create an anonymous variable (for its scope)
LogContext::ScopedParam sp(lc, Param("archiveFileID", 12345));
LogContext::ScopedParam sp(lc, Param("fileId", 12345));
ASSERT_EQ(2U, lc.size());
lc.log(DEBUG, "Two params message");
{
// Test that we do not allow duplicate params
LogContext::ScopedParam sp(lc, Param("archiveFileID", 123456));
LogContext::ScopedParam sp(lc, Param("fileId", 123456));
ASSERT_EQ(2U, lc.size());
LogContext::ScopedParam sp2(lc, Param("TPVID", "T1234"));
ASSERT_EQ(3U, lc.size());
......@@ -57,16 +57,16 @@ namespace unitTests {
std::string first = sl.getLog();
ASSERT_NE(std::string::npos, first.find("MigrationRequestId"));
{
LogContext::ScopedParam sp(lc, Param("archiveFileID", 12345));
LogContext::ScopedParam sp(lc, Param("fileId", 12345));
lc.log(INFO, "Second log");
}
std::string second = sl.getLog();
ASSERT_NE(std::string::npos, second.find("archiveFileID"));
ASSERT_NE(std::string::npos, second.find("fileId"));
// We expect the NSFILEID parameter to show up only once (i.e, not after
// offset, which marks the end of its first occurrence).
lc.log(INFO, "Third log");
std::string third = sl.getLog();
size_t offset = third.find("archiveFileID") + strlen("archiveFileID");
ASSERT_EQ(std::string::npos, third.find("archiveFileID", offset));
size_t offset = third.find("fileId") + strlen("fileId");
ASSERT_EQ(std::string::npos, third.find("fileId", offset));
}
}
......@@ -1593,7 +1593,7 @@ auto OStoreDB::ArchiveMount::getNextJob(log::LogContext &logContext) -> std::uni
params.add("tapepool", mountInfo.tapePool)
.add("queueObject", aq.getAddressIfSet())
.add("jobObject", privateRet->m_archiveRequest.getAddressIfSet())
.add("fileID", privateRet->m_archiveRequest.getArchiveFile().archiveFileID);
.add("fileId", privateRet->m_archiveRequest.getArchiveFile().archiveFileID);
logContext.log(log::INFO, "In ArchiveMount::getNextJob(): popped job from queue");
return std::unique_ptr<SchedulerDatabase::ArchiveJob> (privateRet.release());
}
......
......@@ -167,7 +167,7 @@ void Scheduler::queueRetrieve(
m_db.queueRetrieve(request, queueCriteria, selectedVid);
auto schedulerDbTime = t.secs();
log::ScopedParamContainer spc(lc);
spc.add("archiveFileID", request.archiveFileID)
spc.add("fileId", request.archiveFileID)
.add("instanceName", instanceName)
.add("diskFilePath", request.diskFileInfo.path)
.add("diskFileOwner", request.diskFileInfo.owner)
......
......@@ -214,7 +214,7 @@ void DiskReadTask::logWithStat(int level,const std::string& msg,cta::log::LogCon
m_stats.transferTime?1.0*m_stats.dataVolume/1000/1000/m_stats.transferTime:0)
.add("openRWCloseToTransferTimeRatio",
m_stats.transferTime?(m_stats.openingTime+m_stats.readWriteTime+m_stats.closingTime)/m_stats.transferTime:0.0)
.add("FILEID",m_archiveJobCachedInfo.fileId)
.add("fileId",m_archiveJobCachedInfo.fileId)
.add("path",m_archiveJobCachedInfo.remotePath);
lc.log(level,msg);
}
......
......@@ -52,7 +52,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,cta::log::LogContext&
cta::utils::Timer totalTime(localTime);
cta::utils::Timer transferTime(localTime);
cta::log::ScopedParamContainer URLcontext(lc);
URLcontext.add("archiveFileID",m_retrieveJob->retrieveRequest.archiveFileID)
URLcontext.add("fileId",m_retrieveJob->retrieveRequest.archiveFileID)
.add("dstURL", m_retrieveJob->retrieveRequest.dstURL)
.add("fSeq",m_retrieveJob->selectedTapeFile().fSeq);
// This out-of-try-catch variables allows us to record the stage of the
......@@ -270,7 +270,7 @@ void DiskWriteTask::logWithStat(int level,const std::string& msg,cta::log::LogCo
m_stats.transferTime?1.0*m_stats.dataVolume/1000/1000/m_stats.transferTime:0)
.add("openRWCloseToTransferTimeRatio",
m_stats.transferTime?(m_stats.openingTime+m_stats.readWriteTime+m_stats.closingTime)/m_stats.transferTime:0.0)
.add("archiveFileID",m_retrieveJob->retrieveRequest.archiveFileID)
.add("fileId",m_retrieveJob->retrieveRequest.archiveFileID)
.add("dstURL",m_retrieveJob->retrieveRequest.dstURL);
lc.log(level,msg);
}
......
......@@ -162,7 +162,7 @@ void MigrationReportPacker::ReportFlush::execute(MigrationReportPacker& reportPa
reportPacker.m_successfulArchiveJobs.pop();
if (!job.get()) continue;
cta::log::ScopedParamContainer params(reportPacker.m_lc);
params.add("archiveFileId", job->archiveFile.archiveFileID)
params.add("fileId", job->archiveFile.archiveFileID)
.add("diskInstance", job->archiveFile.diskInstance)
.add("diskFileId", job->archiveFile.diskFileId)
.add("lastKnownDiskPath", job->archiveFile.diskFileInfo.path);
......@@ -179,7 +179,7 @@ void MigrationReportPacker::ReportFlush::execute(MigrationReportPacker& reportPa
cta::log::ScopedParamContainer params(reportPacker.m_lc);
params.add("exceptionMessageValue", e.getMessageValue());
if (job.get()) {
params.add("archiveFileId", job->archiveFile.archiveFileID)
params.add("fileId", job->archiveFile.archiveFileID)
.add("diskInstance", job->archiveFile.diskInstance)
.add("diskFileId", job->archiveFile.diskFileId)
.add("lastKnownDiskPath", job->archiveFile.diskFileInfo.path);
......@@ -191,7 +191,7 @@ void MigrationReportPacker::ReportFlush::execute(MigrationReportPacker& reportPa
cta::log::ScopedParamContainer params(reportPacker.m_lc);
params.add("exceptionWhat", e.what());
if (job.get()) {
params.add("archiveFileId", job->archiveFile.archiveFileID)
params.add("fileId", job->archiveFile.archiveFileID)
.add("diskInstance", job->archiveFile.diskInstance)
.add("diskFileId", job->archiveFile.diskFileId)
.add("lastKnownDiskPath", job->archiveFile.diskFileInfo.path);
......
......@@ -56,7 +56,7 @@ namespace daemon {
for(auto it= jobs.begin();it!=jobs.end();++it){
const uint64_t fileSize = (*it)->archiveFile.fileSize;
LogContext::ScopedParam sp[]={
LogContext::ScopedParam(m_lc, Param("archiveFileID", (*it)->archiveFile.archiveFileID)),
LogContext::ScopedParam(m_lc, Param("fileId", (*it)->archiveFile.archiveFileID)),
LogContext::ScopedParam(m_lc, Param("fSeq", (*it)->tapeFile.fSeq)),
LogContext::ScopedParam(m_lc, Param("path", (*it)->srcURL))
};
......
......@@ -90,7 +90,7 @@ void RecallTaskInjector::injectBulkRecalls(std::vector<std::unique_ptr<cta::Retr
(*it)->positioningMethod=cta::PositioningMethod::ByBlock;
LogContext::ScopedParam sp[]={
LogContext::ScopedParam(m_lc, Param("archiveFileID", (*it)->retrieveRequest.archiveFileID)),
LogContext::ScopedParam(m_lc, Param("fileId", (*it)->retrieveRequest.archiveFileID)),
LogContext::ScopedParam(m_lc, Param("fSeq", (*it)->selectedTapeFile().fSeq)),
LogContext::ScopedParam(m_lc, Param("blockID", (*it)->selectedTapeFile().blockId)),
LogContext::ScopedParam(m_lc, Param("dstURL", (*it)->retrieveRequest.dstURL))
......
......@@ -78,7 +78,7 @@ template <class PlaceHolder> class ReportPackerInterface{
for(typename C::const_iterator it=c.begin();it!=c.end();++it)
{
cta::log::ScopedParamContainer sp(m_lc);
sp.add("archiveFileID",(*it)->fileid())
sp.add("fileId",(*it)->fileid())
.add("NSFSEQ", (*it)->fseq())
.add("NSHOST", (*it)->nshost())
.add("NSFILETRANSACTIONID", (*it)->fileTransactionId());
......@@ -97,7 +97,7 @@ template <class PlaceHolder> class ReportPackerInterface{
for(typename C::const_iterator it=c.begin();it!=c.end();++it)
{
cta::log::ScopedParamContainer sp(m_lc);
sp.add("archiveFileID",(*it)->fileid())
sp.add("fileId",(*it)->fileid())
.add("NSFSEQ", (*it)->fseq())
.add("NSHOST", (*it)->nshost())
.add("NSFILETRANSACTIONID", (*it)->fileTransactionId())
......
......@@ -68,7 +68,7 @@ public:
// Set the common context for all the coming logs (file info)
cta::log::ScopedParamContainer params(lc);
params.add("archiveFileID", m_retrieveJob->archiveFile.archiveFileID)
params.add("fileId", m_retrieveJob->archiveFile.archiveFileID)
.add("BlockId", m_retrieveJob->selectedTapeFile().blockId)
.add("fSeq", m_retrieveJob->selectedTapeFile().fSeq)
.add("dstURL", m_retrieveJob->retrieveRequest.dstURL);
......
......@@ -315,7 +315,7 @@ namespace daemon {
.add("payloadTransferSpeedMBps",m_taskStats.totalTime?
1.0*m_taskStats.dataVolume/1000/1000/m_taskStats.totalTime:0.0)
.add("fileSize",m_archiveFile.fileSize)
.add("archiveFileID",m_archiveFile.archiveFileID)
.add("fileId",m_archiveFile.archiveFileID)
.add("fSeq",m_tapeFile.fSeq)
.add("reconciliationTime",m_archiveFile.reconciliationTime)
.add("LBPMode", m_LBPMode);
......
......@@ -447,7 +447,7 @@ private:
cta::log::ScopedParamContainer params(m_lc);
params.add("TimeSinceLastBlockMove", m_blockMovementTimer.secs())
.add("fileId", m_fileId)
.add("archiveFileID",m_fileId)
.add("fileId",m_fileId)
.add("fSeq",m_fSeq);
m_lc.log(cta::log::WARNING, "No tape block movement for too long");
}
......@@ -498,7 +498,7 @@ private:
virtual void logStuckFile() {
cta::log::ScopedParamContainer params(m_lc);
params.add("TimeSinceLastBlockMove", m_blockMovementTimer.secs())
.add("archiveFileID",m_fileId)
.add("fileId",m_fileId)
.add("fSeq",m_fSeq);
m_lc.log(cta::log::WARNING, "No tape block movement for too long");
}
......
......@@ -2090,7 +2090,7 @@ void XrdCtaFile::xCom_deletearchive() {
std::list<cta::log::Param> params;
params.push_back(cta::log::Param("USERNAME", m_cliIdentity.username));
params.push_back(cta::log::Param("HOST", m_cliIdentity.host));
params.push_back(cta::log::Param("archiveFileID", std::to_string(archiveFile.archiveFileID)));
params.push_back(cta::log::Param("fileId", std::to_string(archiveFile.archiveFileID)));
params.push_back(cta::log::Param("diskInstance", archiveFile.diskInstance));
params.push_back(cta::log::Param("diskFileId", archiveFile.diskFileId));
params.push_back(cta::log::Param("diskFileInfo.path", archiveFile.diskFileInfo.path));
......
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