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
9a894914
Commit
9a894914
authored
3 years ago
by
Jorge Camarero Vera
Browse files
Options
Downloads
Patches
Plain Diff
Add diskSpaceReservations map in cta-admin --json dr ls output. cta/CTA#988
parent
9a382ffa
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/CtaAdminTextFormatter.cpp
+20
-16
20 additions, 16 deletions
cmdline/CtaAdminTextFormatter.cpp
xroot_plugins/XrdCtaDriveLs.hpp
+2
-0
2 additions, 0 deletions
xroot_plugins/XrdCtaDriveLs.hpp
xrootd-ssi-protobuf-interface
+1
-1
1 addition, 1 deletion
xrootd-ssi-protobuf-interface
with
23 additions
and
17 deletions
cmdline/CtaAdminTextFormatter.cpp
+
20
−
16
View file @
9a894914
...
...
@@ -26,7 +26,7 @@
namespace
cta
{
namespace
admin
{
/**
** Generic utility methods
**/
...
...
@@ -51,15 +51,15 @@ std::string TextFormatter::timeToStr(const time_t &unixtime) {
std
::
string
TextFormatter
::
secondsToDayHoursMinSec
(
const
uint64_t
&
seconds
){
uint64_t
secondsSave
=
seconds
;
int
day
=
secondsSave
/
(
24
*
3600
);
secondsSave
=
secondsSave
%
(
24
*
3600
);
int
hour
=
secondsSave
/
3600
;
int
day
=
secondsSave
/
(
24
*
3600
);
secondsSave
=
secondsSave
%
(
24
*
3600
);
int
hour
=
secondsSave
/
3600
;
secondsSave
%=
3600
;
int
minutes
=
secondsSave
/
60
;
secondsSave
%=
3600
;
int
minutes
=
secondsSave
/
60
;
secondsSave
%=
60
;
secondsSave
%=
60
;
std
::
stringstream
ss
;
if
(
day
){
ss
<<
day
<<
"d"
;
...
...
@@ -156,7 +156,7 @@ void TextFormatter::printAdminLsHeader() {
push_back
(
"user"
,
"c.user"
,
"c.host"
,
"c.host"
,
"c.time"
,
"m.user"
,
"m.host"
,
...
...
@@ -230,7 +230,9 @@ void TextFormatter::printDriveLsHeader() {
"priority"
,
"activity"
,
"age"
,
"reason"
"reason"
,
"disk_system_name"
,
"reserved_bytes"
);
}
...
...
@@ -270,7 +272,7 @@ void TextFormatter::print(const DriveLsItem &drls_item)
//If there is a reason, we only want to display the beginning
std
::
string
reason
=
cta
::
utils
::
postEllipsis
(
drls_item
.
reason
(),
NB_CHAR_REASON
);
push_back
(
drls_item
.
logical_library
(),
drls_item
.
drive_name
(),
...
...
@@ -289,7 +291,9 @@ void TextFormatter::print(const DriveLsItem &drls_item)
drls_item
.
current_priority
(),
drls_item
.
current_activity
(),
timeSinceLastUpdate
,
reason
reason
,
drls_item
.
disk_system_name
(),
drls_item
.
reserved_bytes
()
);
}
...
...
@@ -707,7 +711,7 @@ void TextFormatter::print(const ShowQueuesItem &sq_item) {
std
::
string
readMaxDrives
;
std
::
string
writeMaxDrives
;
if
(
sq_item
.
mount_type
()
==
ARCHIVE_FOR_USER
||
sq_item
.
mount_type
()
==
ARCHIVE_FOR_REPACK
||
if
(
sq_item
.
mount_type
()
==
ARCHIVE_FOR_USER
||
sq_item
.
mount_type
()
==
ARCHIVE_FOR_REPACK
||
sq_item
.
mount_type
()
==
RETRIEVE
)
{
priority
=
std
::
to_string
(
sq_item
.
priority
());
minAge
=
std
::
to_string
(
sq_item
.
min_age
());
...
...
@@ -923,7 +927,7 @@ void TextFormatter::printTapePoolLsHeader() {
void
TextFormatter
::
print
(
const
TapePoolLsItem
&
tpls_item
)
{
uint64_t
avail
=
tpls_item
.
capacity_bytes
()
>
tpls_item
.
data_bytes
()
?
tpls_item
.
capacity_bytes
()
-
tpls_item
.
data_bytes
()
:
0
;
tpls_item
.
capacity_bytes
()
-
tpls_item
.
data_bytes
()
:
0
;
double
use_percent
=
tpls_item
.
capacity_bytes
()
>
0
?
(
static_cast
<
double
>
(
tpls_item
.
data_bytes
())
/
static_cast
<
double
>
(
tpls_item
.
capacity_bytes
()))
*
100.0
:
0.0
;
...
...
@@ -970,7 +974,7 @@ void TextFormatter::printDiskSystemLsHeader() {
}
void
TextFormatter
::
print
(
const
DiskSystemLsItem
&
dsls_item
)
{
{
push_back
(
dsls_item
.
name
(),
dsls_item
.
file_regexp
(),
...
...
@@ -1083,7 +1087,7 @@ void TextFormatter::print(const RecycleTapeFileLsItem & rtfls_item){
auto
fid
=
strtol
(
rtfls_item
.
disk_file_id
().
c_str
(),
nullptr
,
10
);
std
::
stringstream
fxid
;
fxid
<<
std
::
hex
<<
fid
;
push_back
(
rtfls_item
.
archive_file_id
(),
rtfls_item
.
copy_nb
(),
...
...
This diff is collapsed.
Click to expand it.
xroot_plugins/XrdCtaDriveLs.hpp
+
2
−
0
View file @
9a894914
...
...
@@ -136,6 +136,8 @@ int DriveLsStream::fillBuffer(XrdSsiPb::OStreamBuffer<Data> *streambuf) {
dr_item
->
set_raw_library_slot
(
dr
.
rawLibrarySlot
?
dr
.
rawLibrarySlot
.
value
()
:
""
);
dr_item
->
set_comment
(
dr
.
userComment
?
dr
.
userComment
.
value
()
:
""
);
dr_item
->
set_reason
(
dr
.
reasonUpDown
?
dr
.
reasonUpDown
.
value
()
:
""
);
dr_item
->
set_disk_system_name
(
dr
.
diskSystemName
);
dr_item
->
set_reserved_bytes
(
dr
.
reservedBytes
);
auto
driveConfig
=
dr_item
->
mutable_drive_config
();
...
...
This diff is collapsed.
Click to expand it.
xrootd-ssi-protobuf-interface
@
d72f41a3
Subproject commit
2f8068955f6622f26e6373a70cfcb4f16435d7ea
Subproject commit
d72f41a33538beb1046406885de8acb172bc6675
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