Commit ae06de9d authored by Eric Cano's avatar Eric Cano
Browse files

Fixes to showqueues.

Added computation of files on tapes (based on last Fseq).
Fixed computation of writable tapes count.
parent 649e6ad4
......@@ -43,6 +43,7 @@ struct QueueAndMountSummary {
double latestBandwidth=0;
uint64_t nextMounts=0;
uint64_t tapesCapacity=0;
uint64_t filesOnTapes=0;
uint64_t dataOnTapes=0;
uint64_t fullTapes=0;
uint64_t emptyTapes=0;
......
......@@ -715,12 +715,13 @@ std::list<common::dataStructures::QueueAndMountSummary> Scheduler::getQueuesAndM
auto tapes=m_catalogue.getTapes(tsc);
for (auto & t:tapes) {
mountOrQueue.tapesCapacity += t.capacityInBytes;
mountOrQueue.filesOnTapes += t.lastFSeq;
mountOrQueue.dataOnTapes += t.dataOnTapeInBytes;
if (!t.dataOnTapeInBytes)
mountOrQueue.emptyTapes++;
if (t.disabled) mountOrQueue.disabledTapes++;
if (t.full) mountOrQueue.fullTapes++;
if (!t.full && t.disabled) mountOrQueue.writableTapes++;
if (!t.full && !t.disabled) mountOrQueue.writableTapes++;
}
} else if (common::dataStructures::MountType::Retrieve==mountOrQueue.mountType) {
// Get info for this tape.
......@@ -732,12 +733,13 @@ std::list<common::dataStructures::QueueAndMountSummary> Scheduler::getQueuesAndM
}
auto &t=tapes.front();
mountOrQueue.tapesCapacity += t.capacityInBytes;
mountOrQueue.filesOnTapes += t.lastFSeq;
mountOrQueue.dataOnTapes += t.dataOnTapeInBytes;
if (!t.dataOnTapeInBytes)
mountOrQueue.emptyTapes++;
if (t.disabled) mountOrQueue.disabledTapes++;
if (t.full) mountOrQueue.fullTapes++;
if (!t.full && t.disabled) mountOrQueue.writableTapes++;
if (!t.full && !t.disabled) mountOrQueue.writableTapes++;
}
}
return ret;
......
......@@ -2034,7 +2034,7 @@ std::string XrdCtaFile::xCom_showqueues() {
if (queuesAndMounts.size()) {
std::vector<std::vector<std::string>> responseTable;
std::vector<std::string> header = {"type","tapepool","vid","files queued","bytes queued","oldest age","priority","min age","max drives",
"cur. mounts", "cur. files", "cur. bytes", "bandwidth", "next mounts", "tapes capacity", "data on tapes", "full tapes", "empty tapes",
"cur. mounts", "cur. files", "cur. bytes", "bandwidth", "next mounts", "tapes capacity", "files on tapes", "data on tapes", "full tapes", "empty tapes",
"disabled tapes", "writables tapes"};
if(hasOption("-h", "--header")) responseTable.push_back(header);
for (auto & q: queuesAndMounts) {
......@@ -2064,6 +2064,7 @@ std::string XrdCtaFile::xCom_showqueues() {
currentRow.push_back(std::to_string(q.latestBandwidth));
currentRow.push_back(std::to_string(q.nextMounts));
currentRow.push_back(std::to_string(q.tapesCapacity));
currentRow.push_back(std::to_string(q.filesOnTapes));
currentRow.push_back(std::to_string(q.dataOnTapes));
currentRow.push_back(std::to_string(q.fullTapes));
currentRow.push_back(std::to_string(q.emptyTapes));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment