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
bde2d2e6
Commit
bde2d2e6
authored
5 years ago
by
Cedric Caffy
Browse files
Options
Downloads
Patches
Plain Diff
Fine-tuned the cta-statistics tools
parent
49873ce3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
statistics/Statistics.cpp
+19
-13
19 additions, 13 deletions
statistics/Statistics.cpp
statistics/StatisticsUpdateCmd.cpp
+3
-3
3 additions, 3 deletions
statistics/StatisticsUpdateCmd.cpp
with
22 additions
and
16 deletions
statistics/Statistics.cpp
+
19
−
13
View file @
bde2d2e6
...
...
@@ -110,18 +110,24 @@ std::unique_ptr<Statistics> Statistics::Builder::build(cta::rdbms::Rset & rset){
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
stream
,
Statistics
stats
)
{
stream
<<
"{"
;
stream
<<
"
\"
statisticsPerVo
\"
: ["
;
for
(
auto
&
stat
:
stats
.
getAllVOStatistics
()){
stream
<<
"{"
;
stream
<<
"
\"
vo
\"
:
\"
"
<<
stat
.
first
<<
"
\"
,"
;
stream
<<
"
\"
nbMasterFiles
\"
: "
<<
stat
.
second
.
nbMasterFiles
<<
","
;
stream
<<
"
\"
masterDataInBytes
\"
: "
<<
stat
.
second
.
masterDataInBytes
<<
","
;
stream
<<
"
\"
nbCopyNb1
\"
: "
<<
stat
.
second
.
nbCopyNb1
<<
","
;
stream
<<
"
\"
copyNb1InBytes
\"
: "
<<
stat
.
second
.
copyNb1InBytes
<<
","
;
stream
<<
"
\"
nbCopyNbGt1
\"
: "
<<
stat
.
second
.
nbCopyNbGt1
<<
","
;
stream
<<
"
\"
copyNbGt1InBytes
\"
: "
<<
stat
.
second
.
copyNbGt1InBytes
;
stream
<<
"},"
;
stream
<<
"{"
<<
"
\"
statisticsPerVo
\"
: ["
;
auto
allVoStatistics
=
stats
.
getAllVOStatistics
();
long
unsigned
int
nbElementsVoStatistics
=
allVoStatistics
.
size
();
long
unsigned
int
i
=
0
;
for
(
auto
&
stat
:
allVoStatistics
){
stream
<<
"{"
<<
"
\"
vo
\"
:
\"
"
<<
stat
.
first
<<
"
\"
,"
<<
"
\"
nbMasterFiles
\"
: "
<<
stat
.
second
.
nbMasterFiles
<<
","
<<
"
\"
masterDataInBytes
\"
: "
<<
stat
.
second
.
masterDataInBytes
<<
","
<<
"
\"
nbCopyNb1
\"
: "
<<
stat
.
second
.
nbCopyNb1
<<
","
<<
"
\"
copyNb1InBytes
\"
: "
<<
stat
.
second
.
copyNb1InBytes
<<
","
<<
"
\"
nbCopyNbGt1
\"
: "
<<
stat
.
second
.
nbCopyNbGt1
<<
","
<<
"
\"
copyNbGt1InBytes
\"
: "
<<
stat
.
second
.
copyNbGt1InBytes
<<
"}"
;
if
(
++
i
<
nbElementsVoStatistics
){
stream
<<
","
;
}
}
stream
<<
"],"
<<
"
\"
totalFiles
\"
: "
<<
stats
.
getTotalFiles
()
<<
","
...
...
@@ -129,7 +135,7 @@ std::ostream & operator <<(std::ostream& stream, Statistics stats) {
<<
"
\"
totalFilesCopyNb1
\"
: "
<<
stats
.
getTotalFilesCopyNb1
()
<<
","
<<
"
\"
totalBytesCopyNb1
\"
: "
<<
stats
.
getTotalBytesCopyNb1
()
<<
","
<<
"
\"
totalFilesCopyNbGt1
\"
: "
<<
stats
.
getTotalFilesCopyNbGt1
()
<<
","
<<
"
\"
totalBytesCopyNbGt1
\"
: "
<<
stats
.
getTotalBytesCopyNbGt1
()
<<
","
<<
"
\"
totalBytesCopyNbGt1
\"
: "
<<
stats
.
getTotalBytesCopyNbGt1
()
<<
"}"
;
return
stream
;
}
...
...
This diff is collapsed.
Click to expand it.
statistics/StatisticsUpdateCmd.cpp
+
3
−
3
View file @
bde2d2e6
...
...
@@ -75,8 +75,8 @@ int StatisticsUpdateCmd::exceptionThrowingMain(const int argc, char *const *cons
"NB_COPY_NB_GT_1"
,
"COPY_NB_GT_1_IN_BYTES"
});
SchemaChecker
::
Status
tapeFileTableStatus
=
catalogueChecker
->
checkTableContainsColumns
(
"TAPE_FILE"
,{
"ARCHIVE_FILE_ID"
,
"
COPY_NB
"
});
SchemaChecker
::
Status
archiveFileTableStatus
=
catalogueChecker
->
checkTableContainsColumns
(
"ARCHIVE_FILE"
,{
"SIZE_IN_BYTES"
});
SchemaChecker
::
Status
tapeFileTableStatus
=
catalogueChecker
->
checkTableContainsColumns
(
"TAPE_FILE"
,{
"
VID"
,
"
ARCHIVE_FILE_ID"
,
"
FSEQ"
,
"COPY_NB"
,
"SUPERSEDED_BY_VID"
,
"SUPERSEDED_BY_FSEQ
"
});
SchemaChecker
::
Status
archiveFileTableStatus
=
catalogueChecker
->
checkTableContainsColumns
(
"ARCHIVE_FILE"
,{
"
ARCHIVE_FILE_ID"
,
"
SIZE_IN_BYTES"
});
if
(
tapeTableStatus
==
SchemaChecker
::
Status
::
FAILURE
||
tapeFileTableStatus
==
SchemaChecker
::
Status
::
FAILURE
||
archiveFileTableStatus
==
SchemaChecker
::
Status
::
FAILURE
){
return
EXIT_FAILURE
;
...
...
@@ -88,7 +88,7 @@ int StatisticsUpdateCmd::exceptionThrowingMain(const int argc, char *const *cons
std
::
cout
<<
"Updating tape statistics in the catalogue..."
<<
std
::
endl
;
cta
::
utils
::
Timer
t
;
service
->
updateStatisticsPerTape
();
std
::
cout
<<
"Updated catalogue tape statistics in "
<<
t
.
secs
()
<<
", "
<<
service
->
getNbUpdatedTapes
()
<<
" tape(s) have been updated"
<<
std
::
endl
;
std
::
cout
<<
"Updated catalogue tape statistics in "
<<
t
.
secs
()
<<
"
seconds
, "
<<
service
->
getNbUpdatedTapes
()
<<
" tape(s) have been updated"
<<
std
::
endl
;
return
EXIT_SUCCESS
;
}
...
...
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