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
b9430ddf
Commit
b9430ddf
authored
6 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[cta-admin] Output summary of failed requests
parent
d5e115b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmdline/CtaAdminCmd.cpp
+15
-4
15 additions, 4 deletions
cmdline/CtaAdminCmd.cpp
xroot_plugins/XrdCtaFailedRequestLs.hpp
+35
-20
35 additions, 20 deletions
xroot_plugins/XrdCtaFailedRequestLs.hpp
xrootd-ssi-protobuf-interface
+1
-1
1 addition, 1 deletion
xrootd-ssi-protobuf-interface
with
51 additions
and
25 deletions
cmdline/CtaAdminCmd.cpp
+
15
−
4
View file @
b9430ddf
...
...
@@ -62,6 +62,8 @@ void IStreamBuffer<cta::xrd::Data>::DataCallback(cta::xrd::Data record) const
switch
(
record
.
data_case
())
{
case
Data
::
kAflsItem
:
std
::
cout
<<
Log
::
DumpProtobuf
(
&
record
.
afls_item
());
break
;
case
Data
::
kAflsSummary
:
std
::
cout
<<
Log
::
DumpProtobuf
(
&
record
.
afls_summary
());
break
;
case
Data
::
kFrlsItem
:
std
::
cout
<<
Log
::
DumpProtobuf
(
&
record
.
frls_item
());
break
;
case
Data
::
kFrlsSummary
:
std
::
cout
<<
Log
::
DumpProtobuf
(
&
record
.
frls_summary
());
break
;
case
Data
::
kLpaItem
:
std
::
cout
<<
Log
::
DumpProtobuf
(
&
record
.
lpa_item
());
break
;
case
Data
::
kLpaSummary
:
std
::
cout
<<
Log
::
DumpProtobuf
(
&
record
.
lpa_summary
());
break
;
case
Data
::
kLprItem
:
std
::
cout
<<
Log
::
DumpProtobuf
(
&
record
.
lpr_item
());
break
;
...
...
@@ -75,6 +77,8 @@ void IStreamBuffer<cta::xrd::Data>::DataCallback(cta::xrd::Data record) const
else
switch
(
record
.
data_case
())
{
case
Data
::
kAflsItem
:
CtaAdminCmd
::
print
(
record
.
afls_item
());
break
;
case
Data
::
kAflsSummary
:
CtaAdminCmd
::
print
(
record
.
afls_summary
());
break
;
case
Data
::
kFrlsItem
:
CtaAdminCmd
::
print
(
record
.
frls_item
());
break
;
case
Data
::
kFrlsSummary
:
CtaAdminCmd
::
print
(
record
.
frls_summary
());
break
;
case
Data
::
kLpaItem
:
CtaAdminCmd
::
print
(
record
.
lpa_item
());
break
;
case
Data
::
kLpaSummary
:
CtaAdminCmd
::
print
(
record
.
lpa_summary
());
break
;
case
Data
::
kLprItem
:
CtaAdminCmd
::
print
(
record
.
lpr_item
());
break
;
...
...
@@ -464,15 +468,22 @@ void CtaAdminCmd::print(const cta::admin::FailedRequestLsItem &frls_item)
void
CtaAdminCmd
::
printFrLsSummaryHeader
()
{
std
::
cout
<<
TEXT_RED
<<
std
::
setfill
(
' '
)
<<
std
::
setw
(
1
1
)
<<
std
::
right
<<
"request type"
<<
' '
<<
std
::
setfill
(
' '
)
<<
std
::
setw
(
13
)
<<
std
::
right
<<
"total files"
<<
' '
<<
std
::
setfill
(
' '
)
<<
std
::
setw
(
1
2
)
<<
std
::
right
<<
"total size"
<<
' '
<<
std
::
setfill
(
' '
)
<<
std
::
setw
(
1
2
)
<<
std
::
right
<<
"request type"
<<
' '
<<
std
::
setfill
(
' '
)
<<
std
::
setw
(
13
)
<<
std
::
right
<<
"total files"
<<
' '
<<
std
::
setfill
(
' '
)
<<
std
::
setw
(
2
0
)
<<
std
::
right
<<
"total size
(bytes)
"
<<
' '
<<
TEXT_NORMAL
<<
std
::
endl
;
}
void
CtaAdminCmd
::
print
(
const
cta
::
admin
::
FailedRequestLsSummary
&
frls_summary
)
{
throw
std
::
runtime_error
(
"Not implemented."
);
std
::
string
request_type
=
frls_summary
.
request_type
()
==
cta
::
admin
::
RequestType
::
ARCHIVE_REQUEST
?
"archive"
:
frls_summary
.
request_type
()
==
cta
::
admin
::
RequestType
::
RETRIEVE_REQUEST
?
"retrieve"
:
"total"
;
std
::
cout
<<
std
::
setfill
(
' '
)
<<
std
::
setw
(
11
)
<<
std
::
right
<<
request_type
<<
' '
<<
std
::
setfill
(
' '
)
<<
std
::
setw
(
13
)
<<
std
::
right
<<
frls_summary
.
total_files
()
<<
' '
<<
std
::
setfill
(
' '
)
<<
std
::
setw
(
20
)
<<
std
::
right
<<
frls_summary
.
total_size
()
<<
' '
<<
std
::
endl
;
}
void
CtaAdminCmd
::
printLpaHeader
()
...
...
This diff is collapsed.
Click to expand it.
xroot_plugins/XrdCtaFailedRequestLs.hpp
+
35
−
20
View file @
b9430ddf
...
...
@@ -19,6 +19,8 @@
#pragma once
#include
<XrdSsiPbOStreamBuffer.hpp>
#include
<objectstore/ArchiveQueue.hpp>
#include
<objectstore/RetrieveQueue.hpp>
#include
<scheduler/Scheduler.hpp>
#include
<scheduler/RetrieveJob.hpp>
...
...
@@ -48,7 +50,6 @@ public:
XrdSsiPb
::
Log
::
Msg
(
XrdSsiPb
::
Log
::
DEBUG
,
LOG_SUFFIX
,
"~FailedRequestLsStream() destructor"
);
}
#if 0
/*!
* Synchronously obtain data from an active stream
*
...
...
@@ -74,7 +75,7 @@ public:
XrdSsiPb
::
OStreamBuffer
<
Data
>
*
streambuf
;
try
{
if(!m_isSummary &&
!m_archiveFileItor.hasMore()
) {
if
(
!
m_isSummary
&&
true
)
{
// Nothing more to send, close the stream
last
=
true
;
return
nullptr
;
...
...
@@ -96,17 +97,8 @@ public:
auto retrieveJobFailedList = m_scheduler.getRetrieveJobsFailedSummary(m_lc);
cmdlineOutput << "Failed retrieve jobs: " << retrieveJobFailedList.size() << std::endl;
#endif
#if 0
// failed archive jobs
auto archive_summary = m_scheduler.getRetrieveJobsFailedSummary(m_lc);
responseTable.push_back({ "archive", std::to_string(archive_summary.candidateFiles), std::to_string(archive_summary.candidateBytes) });
// failed retrieve jobs
auto retrieve_summary = m_scheduler.getRetrieveJobsFailedSummary(m_lc);
responseTable.push_back({ "retrieve", std::to_string(retrieve_summary.candidateFiles), std::to_string(retrieve_summary.candidateBytes) });
#endif
#if 0
for(bool is_buffer_full = false; m_archiveFileItor.hasMore() && !is_buffer_full; )
{
const cta::common::dataStructures::FailedRequest archiveFile = m_archiveFileItor.next();
...
...
@@ -145,6 +137,7 @@ public:
is_buffer_full = streambuf->Push(record);
}
}
#endif
dlen
=
streambuf
->
Size
();
XrdSsiPb
::
Log
::
Msg
(
XrdSsiPb
::
Log
::
DEBUG
,
LOG_SUFFIX
,
"GetBuff(): Returning buffer with "
,
dlen
,
" bytes of data."
);
}
catch
(
cta
::
exception
::
Exception
&
ex
)
{
...
...
@@ -162,26 +155,48 @@ public:
}
return
streambuf
;
}
#endif
#if 0
// failed archive jobs
auto archive_summary = m_scheduler.getRetrieveJobsFailedSummary(m_lc);
responseTable.push_back({ "archive", std::to_string(archive_summary.candidateFiles), std::to_string(archive_summary.candidateBytes) });
// failed retrieve jobs
auto retrieve_summary = m_scheduler.getRetrieveJobsFailedSummary(m_lc);
responseTable.push_back({ "retrieve", std::to_string(retrieve_summary.candidateFiles), std::to_string(retrieve_summary.candidateBytes) });
#endif
void
GetBuffSummary
(
XrdSsiPb
::
OStreamBuffer
<
Data
>
*
streambuf
)
{
common::dataStructures::FailedRequestSummary summary = m_catalogue.getTapeFileSummary(m_searchCriteria);
Data record;
cta
::
objectstore
::
ArchiveQueue
::
CandidateJobList
archive_summary
;
cta
::
objectstore
::
RetrieveQueue
::
CandidateJobList
retrieve_summary
;
// Summary statistics
record.mutable_afls_summary()->set_total_files(summary.totalFiles);
record.mutable_afls_summary()->set_total_size(summary.totalBytes);
Data
record
;
streambuf->Push(record);
if
(
m_isArchive
)
{
record
.
mutable_frls_summary
()
->
set_request_type
(
cta
::
admin
::
RequestType
::
ARCHIVE_REQUEST
);
record
.
mutable_frls_summary
()
->
set_total_files
(
archive_summary
.
candidateFiles
);
record
.
mutable_frls_summary
()
->
set_total_size
(
archive_summary
.
candidateBytes
);
streambuf
->
Push
(
record
);
}
if
(
m_isRetrieve
)
{
record
.
mutable_frls_summary
()
->
set_request_type
(
cta
::
admin
::
RequestType
::
RETRIEVE_REQUEST
);
record
.
mutable_frls_summary
()
->
set_total_files
(
retrieve_summary
.
candidateFiles
);
record
.
mutable_frls_summary
()
->
set_total_size
(
retrieve_summary
.
candidateBytes
);
streambuf
->
Push
(
record
);
}
if
(
m_isArchive
&&
m_isRetrieve
)
{
record
.
mutable_frls_summary
()
->
set_request_type
(
cta
::
admin
::
RequestType
::
TOTAL
);
record
.
mutable_frls_summary
()
->
set_total_files
(
archive_summary
.
candidateFiles
+
retrieve_summary
.
candidateFiles
);
record
.
mutable_frls_summary
()
->
set_total_size
(
archive_summary
.
candidateBytes
+
retrieve_summary
.
candidateBytes
);
streambuf
->
Push
(
record
);
}
m_isSummary
=
false
;
}
#endif
private
:
Scheduler
&
m_scheduler
;
//!< Reference to CTA Scheduler
bool
m_isArchive
;
//!< List failed archive requests
bool
m_isRetrieve
;
//!< List failed retrieve requests
bool
m_isLogEntries
;
//!< Show failure log messages (verbose)
...
...
This diff is collapsed.
Click to expand it.
xrootd-ssi-protobuf-interface
@
3c85295b
Subproject commit
515045f34d3fc26d8259b548b469e7d025468a61
Subproject commit
3c85295b463f14a5b6959b826d01696b42892f27
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