Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
0e17aca1
Commit
0e17aca1
authored
Jul 24, 2014
by
David COME
Browse files
Renamed SessionStats in TapeSessionStats
parent
592f9d1c
Changes
5
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/TapeReadTask.hpp
View file @
0e17aca1
...
...
@@ -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/
Tape
SessionStats.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
)
{
Tape
SessionStats
&
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
;
Tape
SessionStats
localStats
;
utils
::
Timer
localTime
;
// Read the file and transmit it
...
...
castor/tape/tapeserver/daemon/SessionStats.hpp
→
castor/tape/tapeserver/daemon/
Tape
SessionStats.hpp
View file @
0e17aca1
...
...
@@ -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
Tape
SessionStats
{
/** 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
),
Tape
SessionStats
()
:
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
Tape
SessionStats
&
other
)
{
mountTime
+=
other
.
mountTime
;
positionTime
+=
other
.
positionTime
;
checksumingTime
+=
other
.
checksumingTime
;
...
...
castor/tape/tapeserver/daemon/TapeSingleThreadInterface.hpp
View file @
0e17aca1
...
...
@@ -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/
Tape
SessionStats.hpp"
namespace
castor
{
namespace
tape
{
...
...
@@ -90,7 +90,7 @@ protected:
int
m_hardarwareStatus
;
/** Session statistics */
SessionStats
m_stats
;
Tape
SessionStats
m_stats
;
/**
* This function will try to set the cap_sys_rawio capability that is needed
...
...
castor/tape/tapeserver/daemon/TapeWriteTask.cpp
View file @
0e17aca1
...
...
@@ -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/
Tape
SessionStats.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
)
{
Tape
SessionStats
&
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
;
Tape
SessionStats
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
+=
Tape
SessionStats
::
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
+=
Tape
SessionStats
::
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
,
Tape
SessionStats
&
localStats
,
log
::
LogContext
&
lc
)
const
{
log
::
ScopedParamContainer
params
(
lc
);
params
.
add
(
"transferTime"
,
localStats
.
transferTime
)
.
add
(
"checksumingTime"
,
localStats
.
checksumingTime
)
...
...
castor/tape/tapeserver/daemon/TapeWriteTask.hpp
View file @
0e17aca1
...
...
@@ -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/
Tape
SessionStats.hpp"
#include
"castor/tape/utils/Timer.hpp"
namespace
castor
{
...
...
@@ -41,7 +41,7 @@ namespace daemon {
class
MigrationReportPacker
;
class
Memblock
;
class
SessionStats
;
class
Tape
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
...
...
@@ -71,7 +71,7 @@ public:
*/
virtual
void
execute
(
castor
::
tape
::
tapeFile
::
WriteSession
&
session
,
MigrationReportPacker
&
reportPacker
,
castor
::
log
::
LogContext
&
lc
,
SessionStats
&
stats
,
utils
::
Timer
&
timer
);
Tape
SessionStats
&
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
,
Tape
SessionStats
&
localStats
,
log
::
LogContext
&
lc
)
const
;
/**
*Throw an exception if m_errorFlag is set
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment