Commit 4c26512b authored by Steven Murray's avatar Steven Murray
Browse files

[Catalogue] operations#179 Slow `cta-admin sq` even when there is very little activity

Scheduler::getQueuesAndMountSummaries() now calls Catalogue::getTapePool()
parent e5862d74
......@@ -1643,21 +1643,18 @@ std::list<common::dataStructures::QueueAndMountSummary> Scheduler::getQueuesAndM
// Add the tape information where useful (archive queues).
for (auto & mountOrQueue: ret) {
if (common::dataStructures::MountType::ArchiveForUser==mountOrQueue.mountType || common::dataStructures::MountType::ArchiveForRepack==mountOrQueue.mountType) {
// Get all the tape for this pool
cta::catalogue::TapeSearchCriteria tsc;
tsc.tapePool = mountOrQueue.tapePool;
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.readOnly) mountOrQueue.readOnlyTapes++;
if (!t.full && !t.disabled && !t.readOnly) mountOrQueue.writableTapes++;
}
const auto tapePool = m_catalogue.getTapePool(mountOrQueue.tapePool);
mountOrQueue.tapesCapacity = tapePool->capacityBytes;
mountOrQueue.filesOnTapes = tapePool->nbPhysicalFiles;
mountOrQueue.dataOnTapes = tapePool->dataBytes;
mountOrQueue.emptyTapes = tapePool->nbEmptyTapes;
mountOrQueue.disabledTapes = tapePool->nbDisabledTapes;
mountOrQueue.fullTapes = tapePool->nbFullTapes;
mountOrQueue.readOnlyTapes = tapePool->nbReadOnlyTapes;
// Please note that archived and exported tapes are NOT taken into account
// for the moment because they are not currently supported
const auto nbNonWritableTape = tapePool->nbDisabledTapes + tapePool->nbFullTapes + tapePool->nbReadOnlyTapes;
mountOrQueue.writableTapes = (tapePool->nbTapes >= nbNonWritableTape) ? tapePool->nbTapes - nbNonWritableTape : 0;
} else if (common::dataStructures::MountType::Retrieve==mountOrQueue.mountType) {
// Get info for this tape.
cta::catalogue::TapeSearchCriteria tsc;
......
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