Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
7e06b628
Commit
7e06b628
authored
10 years ago
by
David COME
Browse files
Options
Downloads
Patches
Plain Diff
Factorized a bunch of log messages in a function in TapeReadSingleThread
parent
686f9376
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
castor/tape/tapeserver/daemon/TapeReadSingleThread.hpp
+33
-41
33 additions, 41 deletions
castor/tape/tapeserver/daemon/TapeReadSingleThread.hpp
with
33 additions
and
41 deletions
castor/tape/tapeserver/daemon/TapeReadSingleThread.hpp
+
33
−
41
View file @
7e06b628
...
...
@@ -235,55 +235,19 @@ private:
}
// The session completed successfully, and the cleaner (unmount) executed
// at the end of the previous block. Log the results.
double
sessionTime
=
totalTimer
.
secs
();
log
::
ScopedParamContainer
params
(
m_logContext
);
params
.
add
(
"mountTime"
,
m_stats
.
mountTime
)
.
add
(
"positionTime"
,
m_stats
.
positionTime
)
.
add
(
"waitInstructionsTime"
,
m_stats
.
waitInstructionsTime
)
.
add
(
"checksumingTime"
,
m_stats
.
checksumingTime
)
.
add
(
"transferTime"
,
m_stats
.
transferTime
)
.
add
(
"waitFreeMemoryTime"
,
m_stats
.
waitFreeMemoryTime
)
.
add
(
"waitReportingTime"
,
m_stats
.
waitReportingTime
)
.
add
(
"flushTime"
,
m_stats
.
flushTime
)
.
add
(
"unloadTime"
,
m_stats
.
unloadTime
)
.
add
(
"unmountTime"
,
m_stats
.
unmountTime
)
.
add
(
"dataVolume"
,
m_stats
.
dataVolume
)
.
add
(
"headerVolume"
,
m_stats
.
headerVolume
)
.
add
(
"filesCount"
,
m_stats
.
filesCount
)
.
add
(
"dataBandwidthMiB/s"
,
1.0
*
m_stats
.
dataVolume
/
1024
/
1024
/
sessionTime
)
.
add
(
"driveBandwidthMiB/s"
,
1.0
*
(
m_stats
.
dataVolume
+
m_stats
.
headerVolume
)
/
1024
/
1024
/
sessionTime
)
.
add
(
"sessionTime"
,
sessionTime
);
m_logContext
.
log
(
LOG_INFO
,
"Completed recall session's tape thread successfully"
);
logWithStat
(
LOG_INFO
,
"Completed recall session's tape thread successfully"
,
params
,
totalTimer
.
secs
());
}
catch
(
const
castor
::
exception
::
Exception
&
e
){
// We end up here because one step failed, be it at mount time, of after
// failing to position by fseq (this is fatal to a read session as we need
// to know where we are to proceed to the next file incrementally in fseq
// positioning mode).
// This can happen late in the session, so we can still print the stats.
double
sessionTime
=
totalTimer
.
secs
();
log
::
ScopedParamContainer
params
(
m_logContext
);
params
.
add
(
"ErrorMesage"
,
e
.
getMessageValue
())
.
add
(
"mountTime"
,
m_stats
.
mountTime
)
.
add
(
"positionTime"
,
m_stats
.
positionTime
)
.
add
(
"waitInstructionsTime"
,
m_stats
.
waitInstructionsTime
)
.
add
(
"checksumingTime"
,
m_stats
.
checksumingTime
)
.
add
(
"transferTime"
,
m_stats
.
transferTime
)
.
add
(
"waitFreeMemoryTime"
,
m_stats
.
waitFreeMemoryTime
)
.
add
(
"waitReportingTime"
,
m_stats
.
waitReportingTime
)
.
add
(
"flushTime"
,
m_stats
.
flushTime
)
.
add
(
"unloadTime"
,
m_stats
.
unloadTime
)
.
add
(
"unmountTime"
,
m_stats
.
unmountTime
)
.
add
(
"dataVolume"
,
m_stats
.
dataVolume
)
.
add
(
"headerVolume"
,
m_stats
.
headerVolume
)
.
add
(
"filesCount"
,
m_stats
.
filesCount
)
.
add
(
"dataBandwidthMiB/s"
,
1.0
*
m_stats
.
dataVolume
/
1024
/
1024
/
sessionTime
)
.
add
(
"driveBandwidthMiB/s"
,
1.0
*
(
m_stats
.
dataVolume
+
m_stats
.
headerVolume
)
/
1024
/
1024
/
sessionTime
)
.
add
(
"sessionTime"
,
sessionTime
);
m_logContext
.
log
(
LOG_ERR
,
"Tape read thread had to be halted because of an error."
);
params
.
add
(
"ErrorMesage"
,
e
.
getMessageValue
());
logWithStat
(
LOG_ERR
,
"Tape read thread had to be halted because of an error"
,
params
,
totalTimer
.
secs
());
// Flush the remaining tasks to cleanly exit.
while
(
1
){
TapeReadTask
*
task
=
m_tasks
.
pop
();
...
...
@@ -295,6 +259,34 @@ private:
}
}
}
/**
* Log msg with the given level, Session time is the time taken by the action
* @param level
* @param msg
* @param sessionTime
*/
void
logWithStat
(
int
level
,
const
std
::
string
&
msg
,
log
::
ScopedParamContainer
&
params
,
double
sessionTime
){
params
.
add
(
"mountTime"
,
m_stats
.
mountTime
)
.
add
(
"positionTime"
,
m_stats
.
positionTime
)
.
add
(
"waitInstructionsTime"
,
m_stats
.
waitInstructionsTime
)
.
add
(
"checksumingTime"
,
m_stats
.
checksumingTime
)
.
add
(
"transferTime"
,
m_stats
.
transferTime
)
.
add
(
"waitFreeMemoryTime"
,
m_stats
.
waitFreeMemoryTime
)
.
add
(
"waitReportingTime"
,
m_stats
.
waitReportingTime
)
.
add
(
"flushTime"
,
m_stats
.
flushTime
)
.
add
(
"unloadTime"
,
m_stats
.
unloadTime
)
.
add
(
"unmountTime"
,
m_stats
.
unmountTime
)
.
add
(
"dataVolume"
,
m_stats
.
dataVolume
)
.
add
(
"headerVolume"
,
m_stats
.
headerVolume
)
.
add
(
"filesCount"
,
m_stats
.
filesCount
)
.
add
(
"dataBandwidthMiB/s"
,
1.0
*
m_stats
.
dataVolume
/
1024
/
1024
/
sessionTime
)
.
add
(
"driveBandwidthMiB/s"
,
1.0
*
(
m_stats
.
dataVolume
+
m_stats
.
headerVolume
)
/
1024
/
1024
/
sessionTime
)
.
add
(
"sessionTime"
,
sessionTime
);
m_logContext
.
log
(
level
,
msg
);
}
/**
* Number of files a single request to the client might give us.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment