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
42e2f9fa
Commit
42e2f9fa
authored
Aug 07, 2017
by
Victor Kotlyar
Browse files
Change view for 'cta drive ls'.
Cleanup/reorder/rename for some fields.
parent
721d6d59
Changes
2
Hide whitespace changes
Inline
Side-by-side
common/dataStructures/DriveStatus.cpp
View file @
42e2f9fa
...
...
@@ -25,7 +25,7 @@ std::string cta::common::dataStructures::toString(cta::common::dataStructures::D
case
cta
::
common
::
dataStructures
::
DriveStatus
::
Down
:
return
"Down"
;
case
cta
::
common
::
dataStructures
::
DriveStatus
::
Up
:
return
"
Up
"
;
return
"
Free
"
;
case
cta
::
common
::
dataStructures
::
DriveStatus
::
Starting
:
return
"Start"
;
case
cta
::
common
::
dataStructures
::
DriveStatus
::
Mounting
:
...
...
xroot_plugins/XrdCtaFile.cpp
View file @
42e2f9fa
...
...
@@ -1825,8 +1825,8 @@ std::string XrdCtaFile::xCom_drive() {
auto
driveStates
=
m_scheduler
->
getDriveStates
(
m_cliIdentity
);
if
(
driveStates
.
size
())
{
std
::
vector
<
std
::
vector
<
std
::
string
>>
responseTable
;
std
::
vector
<
std
::
string
>
headers
=
{
"drive"
,
"host"
,
"library"
,
"request"
,
"status"
,
"since"
,
"desired"
,
"vid"
,
"tapepool"
,
"files"
,
"Mbytes"
,
std
::
vector
<
std
::
string
>
headers
=
{
"drive"
,
"host"
,
"library"
,
"desired"
,
"request"
,
"status"
,
"since"
,
"vid"
,
"tapepool"
,
"files"
,
"Mbytes"
,
"speed"
,
"session"
,
"age"
};
responseTable
.
push_back
(
headers
);
typedef
decltype
(
*
driveStates
.
begin
())
dStateVal
;
...
...
@@ -1838,6 +1838,7 @@ std::string XrdCtaFile::xCom_drive() {
currentRow
.
push_back
(
ds
.
driveName
);
currentRow
.
push_back
(
ds
.
host
);
currentRow
.
push_back
(
ds
.
logicalLibrary
);
currentRow
.
push_back
(
ds
.
desiredDriveState
.
up
?
"Up"
:
"Down"
);
currentRow
.
push_back
(
cta
::
common
::
dataStructures
::
toString
(
ds
.
mountType
));
currentRow
.
push_back
(
cta
::
common
::
dataStructures
::
toString
(
ds
.
driveStatus
));
// print the time spent in the current state
...
...
@@ -1871,13 +1872,28 @@ std::string XrdCtaFile::xCom_drive() {
currentRow
.
push_back
(
"-"
);
break
;
}
currentRow
.
push_back
(
ds
.
desiredDriveState
.
up
?
"Up"
:
"Down"
);
currentRow
.
push_back
(
ds
.
currentVid
==
""
?
"-"
:
ds
.
currentVid
);
currentRow
.
push_back
(
ds
.
currentTapePool
==
""
?
"-"
:
ds
.
currentTapePool
);
currentRow
.
push_back
(
std
::
to_string
((
unsigned
long
long
)
ds
.
filesTransferredInSession
));
currentRow
.
push_back
(
std
::
to_string
((
long
double
)
ds
.
bytesTransferredInSession
/
Mbytes
));
currentRow
.
push_back
(
std
::
to_string
((
long
double
)
ds
.
latestBandwidth
/
Mbytes
));
currentRow
.
push_back
(
std
::
to_string
((
unsigned
long
long
)
ds
.
sessionId
));
switch
(
ds
.
driveStatus
)
{
case
cta
::
common
::
dataStructures
::
DriveStatus
::
Transferring
:
currentRow
.
push_back
(
std
::
to_string
((
unsigned
long
long
)
ds
.
filesTransferredInSession
));
currentRow
.
push_back
(
std
::
to_string
((
long
double
)
ds
.
bytesTransferredInSession
/
Mbytes
));
currentRow
.
push_back
(
std
::
to_string
((
long
double
)
ds
.
latestBandwidth
/
Mbytes
));
break
;
default:
currentRow
.
push_back
(
"-"
);
currentRow
.
push_back
(
"-"
);
currentRow
.
push_back
(
"-"
);
}
switch
(
ds
.
driveStatus
)
{
case
cta
::
common
::
dataStructures
::
DriveStatus
::
Up
:
case
cta
::
common
::
dataStructures
::
DriveStatus
::
Down
:
case
cta
::
common
::
dataStructures
::
DriveStatus
::
Unknown
:
currentRow
.
push_back
(
"-"
);
break
;
default:
currentRow
.
push_back
(
std
::
to_string
((
unsigned
long
long
)
ds
.
sessionId
));
}
currentRow
.
push_back
(
std
::
to_string
((
unsigned
long
long
)(
time
(
nullptr
)
-
ds
.
lastUpdateTime
)));
responseTable
.
push_back
(
currentRow
);
}
...
...
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