diff --git a/scheduler/ArchiveJob.cpp b/scheduler/ArchiveJob.cpp index 627dc38c9ba2d3bb916596121eccd3fb2a638b3d..af23c6069a9b82960deff18e6ab04c280ebea85a 100644 --- a/scheduler/ArchiveJob.cpp +++ b/scheduler/ArchiveJob.cpp @@ -54,11 +54,19 @@ bool cta::ArchiveJob::checkAndAsyncReportComplete() { if (m_dbJob->checkSucceed()) { m_reporter.reset(m_mount.createDiskReporter(m_dbJob->archiveReportURL, m_reporterState)); m_reporter->asyncReportArchiveFullyComplete(); + m_reporterTimer.reset(); return true; } return false; } +//------------------------------------------------------------------------------ +// getReportTiming() +//------------------------------------------------------------------------------ +double cta::ArchiveJob::reportTime() { + return m_reporterTimer.secs(); +} + //------------------------------------------------------------------------------ // ArchiveJob::writeToCatalogue //------------------------------------------------------------------------------ diff --git a/scheduler/ArchiveJob.hpp b/scheduler/ArchiveJob.hpp index 30ca2c4790dda3a7757e864156f5007eeed7918a..4c881959c8db0f3b30daed65cea432c9203f26ea 100644 --- a/scheduler/ArchiveJob.hpp +++ b/scheduler/ArchiveJob.hpp @@ -20,6 +20,7 @@ #include "common/exception/Exception.hpp" #include "common/remoteFS/RemotePathAndStatus.hpp" +#include "common/Timer.hpp" #include "scheduler/SchedulerDatabase.hpp" #include "catalogue/Catalogue.hpp" #include "eos/DiskReporter.hpp" @@ -83,6 +84,11 @@ public: */ virtual bool checkAndAsyncReportComplete(); + /** + * Get the report time (in seconds). + */ + double reportTime(); + /** * Validate that archiveFile and tapeFile fields are set correctly for archive * request. @@ -124,10 +130,15 @@ private: std::unique_ptr<cta::SchedulerDatabase::ArchiveJob> m_dbJob; /** - * The reporter for the job. + * The reporter for the job. TODO: this should be generic and fed with a factory. */ std::unique_ptr<cta::eos::DiskReporter> m_reporter; + /** + * Report time measurement. + */ + utils::Timer m_reporterTimer; + /** * The mount that generated this job */ diff --git a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp index c6f1ab7cedb84463b1c1076ed6023c131750b10f..4e2834d2c6d3e07ec130a149d12e5c734faedf8a 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp @@ -292,7 +292,8 @@ void MigrationReportPacker::ReportFlush::checkAndAsyncReportCompletedJobs( "In MigrationReportPacker::ReportFlush::checkAndAsyncReportCompletedJobs()" " check for async backend update finished"); if(job->checkAndAsyncReportComplete()) { - params.add("reportURL", job->reportURL()); + params.add("reportURL", job->reportURL()) + .add("reportTime", job->reportTime()); reportedArchiveJobs.emplace_back(std::move(job)); logContext.log(cta::log::INFO,"Sent to the client a full file archival"); } else {