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

Renamed SessionStats in TapeSessionStats

parent 592f9d1c
......@@ -30,7 +30,7 @@
#include "castor/tape/tapeserver/exception/Exception.hpp"
#include "castor/tape/tapeserver/daemon/AutoReleaseBlock.hpp"
#include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp"
#include "castor/tape/tapeserver/daemon/SessionStats.hpp"
#include "castor/tape/tapeserver/daemon/TapeSessionStats.hpp"
#include "castor/tape/utils/Timer.hpp"
namespace castor {
......@@ -62,7 +62,7 @@ public:
*/
void execute(castor::tape::tapeFile::ReadSession & rs,
castor::log::LogContext & lc,TaskWatchDog<detail::Recall>& watchdog,
SessionStats & stats, utils::Timer & timer) {
TapeSessionStats & stats, utils::Timer & timer) {
using castor::log::Param;
typedef castor::log::LogContext::ScopedParam ScopedParam;
......@@ -76,7 +76,7 @@ public:
// We will clock the stats for the file itself, and eventually add those
// stats to the session's.
SessionStats localStats;
TapeSessionStats localStats;
utils::Timer localTime;
// Read the file and transmit it
......
......@@ -31,7 +31,7 @@ namespace daemon {
* Structure holding the timers and stats for the tape session. We use doubles,
* for time and all measurements are in seconds or uint64_t for bytes.
*/
struct SessionStats {
struct TapeSessionStats {
/** Mounting time, in seconds */
double mountTime;
......@@ -77,13 +77,13 @@ namespace daemon {
static const uint64_t headerVolumePerFile = 3*80;
/** Constructor: all defaults are zero */
SessionStats(): mountTime(0.0), positionTime(0.0), checksumingTime(0.0),
TapeSessionStats(): mountTime(0.0), positionTime(0.0), checksumingTime(0.0),
transferTime(0.0), flushTime(0.0), unloadTime(0.0), unmountTime(0.0),
waitDataTime(0.0), waitFreeMemoryTime(0.0), waitInstructionsTime(0.0),
waitReportingTime(0.0), dataVolume(0), headerVolume(0), filesCount(0) {}
/** Accumulate contents of another stats block */
void add(const SessionStats& other) {
void add(const TapeSessionStats& other) {
mountTime += other.mountTime;
positionTime += other.positionTime;
checksumingTime += other.checksumingTime;
......
......@@ -36,7 +36,7 @@
#include "castor/tape/tapeserver/drive/DriveInterface.hpp"
#include "castor/tape/tapeserver/client/ClientInterface.hpp"
#include "castor/tape/utils/Timer.hpp"
#include "castor/tape/tapeserver/daemon/SessionStats.hpp"
#include "castor/tape/tapeserver/daemon/TapeSessionStats.hpp"
namespace castor {
namespace tape {
......@@ -90,7 +90,7 @@ protected:
int m_hardarwareStatus;
/** Session statistics */
SessionStats m_stats;
TapeSessionStats m_stats;
/**
* This function will try to set the cap_sys_rawio capability that is needed
......
......@@ -31,7 +31,7 @@
#include "castor/tape/tapeserver/daemon/AutoReleaseBlock.hpp"
#include "castor/tape/tapeserver/exception/Exception.hpp"
#include "castor/tape/tapeserver/daemon/MigrationReportPacker.hpp"
#include "castor/tape/tapeserver/daemon/SessionStats.hpp"
#include "castor/tape/tapeserver/daemon/TapeSessionStats.hpp"
#include "castor/tape/tapeserver/daemon/MemBlock.hpp"
namespace castor {
......@@ -61,13 +61,13 @@ namespace daemon {
//------------------------------------------------------------------------------
void TapeWriteTask::execute(castor::tape::tapeFile::WriteSession & session,
MigrationReportPacker & reportPacker,castor::log::LogContext& lc,
SessionStats & stats, utils::Timer & timer) {
TapeSessionStats & stats, utils::Timer & timer) {
using castor::log::LogContext;
using castor::log::Param;
// We will clock the stats for the file itself, and eventually add those
// stats to the session's.
SessionStats localStats;
TapeSessionStats localStats;
utils::Timer localTime;
unsigned long ckSum = Payload::zeroAdler32();
......@@ -82,7 +82,7 @@ namespace daemon {
//try to open the session
std::auto_ptr<castor::tape::tapeFile::WriteFile> output(openWriteFile(session,lc));
localStats.transferTime += timer.secs(utils::Timer::resetCounter);
localStats.headerVolume += SessionStats::headerVolumePerFile;
localStats.headerVolume += TapeSessionStats::headerVolumePerFile;
while(!m_fifo.finished()) {
//if someone screw somewhere else, we stop
......@@ -109,7 +109,7 @@ namespace daemon {
//put the trailer
output->close();
localStats.transferTime += timer.secs(utils::Timer::resetCounter);
localStats.headerVolume += SessionStats::headerVolumePerFile;
localStats.headerVolume += TapeSessionStats::headerVolumePerFile;
localStats.filesCount ++;
reportPacker.reportCompletedJob(*m_fileToMigrate,ckSum);
localStats.waitReportingTime += timer.secs(utils::Timer::resetCounter);
......@@ -239,7 +239,7 @@ namespace daemon {
}
void TapeWriteTask::logWithStats(int level, const std::string& msg,
double fileTime,SessionStats& localStats,log::LogContext& lc) const{
double fileTime,TapeSessionStats& localStats,log::LogContext& lc) const{
log::ScopedParamContainer params(lc);
params.add("transferTime", localStats.transferTime)
.add("checksumingTime",localStats.checksumingTime)
......
......@@ -31,7 +31,7 @@
#include "castor/tape/tapegateway/FileToMigrateStruct.hpp"
#include "castor/log/LogContext.hpp"
#include "castor/tape/tapeserver/threading/AtomicCounter.hpp"
#include "castor/tape/tapeserver/daemon/SessionStats.hpp"
#include "castor/tape/tapeserver/daemon/TapeSessionStats.hpp"
#include "castor/tape/utils/Timer.hpp"
namespace castor {
......@@ -41,7 +41,7 @@ namespace daemon {
class MigrationReportPacker;
class Memblock;
class SessionStats;
class TapeSessionStats;
/**
* 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
......@@ -71,7 +71,7 @@ public:
*/
virtual void execute(castor::tape::tapeFile::WriteSession & session,
MigrationReportPacker & reportPacker,castor::log::LogContext& lc,
SessionStats & stats, utils::Timer & timer);
TapeSessionStats & stats, utils::Timer & timer);
/**
* Used to reclaim used memory blocks
......@@ -101,7 +101,7 @@ private:
* into lc with msg at the given level
*/
void logWithStats(int level, const std::string& msg,
double fileTime,SessionStats& localStats,log::LogContext& lc) const;
double fileTime,TapeSessionStats& localStats,log::LogContext& lc) const;
/**
*Throw an exception if m_errorFlag is set
......
Markdown is supported
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