Skip to content

Commit

Permalink
httpd: Do now show maximum for restore and flush queues
Browse files Browse the repository at this point in the history
Motivation:

Pools no longer have a maximum for active restores or flushes. A specific
provider implementation may have such limits, but the pool and the rest of
dCache are unaware of such implementation details. httpd, webadmin and info
however show 0 as the maximum.

Modification:

Updates httpd and info to not show a maximum. In case of httpd this is achieved
by showing an empty column (easier than hiding the entire column). Somebody
else has to update webadmin.

Target: trunk
Require-notes: yes
Require-book: yes
Request: 2.13
Request: 2.12
Request: 2.11
Request: 2.10
Bug: #1638
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/8319/
  • Loading branch information
gbehrmann committed Jun 19, 2015
1 parent 53f637e commit 38ec2c7
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 10 deletions.
Expand Up @@ -84,8 +84,8 @@ private StateUpdate buildUpdate(Collection<PoolCostInfo> poolInfos,
/*
* Add all the standard queues
*/
addQueueInfo(update, pathToQueues, "store", thisPoolInfo.getStoreQueue(), metricLifetime);
addQueueInfo(update, pathToQueues, "restore", thisPoolInfo.getRestoreQueue(), metricLifetime);
addTapeQueueInfo(update, pathToQueues, "store", thisPoolInfo.getStoreQueue(), metricLifetime);
addTapeQueueInfo(update, pathToQueues, "restore", thisPoolInfo.getRestoreQueue(), metricLifetime);
addQueueInfo(update, pathToQueues, "mover", thisPoolInfo.getMoverQueue(), metricLifetime);
addQueueInfo(update, pathToQueues, "p2p-queue", thisPoolInfo.getP2pQueue(), metricLifetime);
addQueueInfo(update, pathToQueues, "p2p-clientqueue", thisPoolInfo.getP2pClientQueue(), metricLifetime);
Expand Down Expand Up @@ -158,6 +158,46 @@ private void addQueueInfo(StateUpdate stateUpdate, StatePath pathToQueues,
new IntegerStateValue(info.getQueued(), lifetime));
}

/**
* Add information about a specific tape queue to a pool's portion of dCache state.
* The state tree looks like:
*
* <pre>
* [dCache]
* |
* +--[pools]
* | |
* | +--[&lt;poolName>]
* | | |
* | | +--[queues]
* | | | |
* | | | +--[&lt;queueName1>]
* | | | | |
* | | | | +--active: nnn
* | | | | +--queued: nnn
* | | | |
* | | | +--[&lt;queueName2>]
* </pre>
*
* The difference to regular queues is that tape queues to not have a public maximum
* value for active tasks (specific providers may have one, but this is internal to
* a provider).
*
* @param pathToQueues the StatePath pointing to queues (e.g.,
* "pools.mypool_1.queues")
* @param queueName the name of the queue.
*/
private void addTapeQueueInfo(StateUpdate stateUpdate, StatePath pathToQueues,
String queueName, PoolQueueInfo info, long lifetime)
{
StatePath queuePath = pathToQueues.newChild(queueName);

stateUpdate.appendUpdate(queuePath.newChild("active"),
new IntegerStateValue(info.getActive(), lifetime));
stateUpdate.appendUpdate(queuePath.newChild("queued"),
new IntegerStateValue(info.getQueued(), lifetime));
}


/**
* Adds information from a pool's PoolSpaceInfo object.
Expand Down
Expand Up @@ -577,12 +577,12 @@ private void printCellInfoRow(CellInfo info, long ping, HTMLBuilder page)
};
rows[1] = new int[]{
restore.getActive(),
restore.getMaxActive(),
-1,
restore.getQueued()
};
rows[2] = new int[]{
store.getActive(),
store.getMaxActive(),
-1,
store.getQueued()
};

Expand Down Expand Up @@ -669,7 +669,11 @@ private void printPoolActionRow(PoolCostEntry info,
page.td(3, "integrated", "Integrated");
} else {
page.td("active", row[0]);
page.td("max", row[1]);
if (row[1] >= 0) {
page.td("max", row[1]);
} else {
page.td("max");
}
if (row[2] > 0) {
page.td("queued", row[2]);
} else {
Expand Down Expand Up @@ -863,7 +867,11 @@ private void printPoolActionTableTotals(HTMLBuilder page,

for (int[] row : total) {
page.td("active", row[0]);
page.td("max", row[1]);
if (row[1] >= 0) {
page.td("max", row[1]);
} else {
page.td("max");
}
page.td("queued", row[2]);
}

Expand Down
Expand Up @@ -112,7 +112,11 @@ private void printPoolActionTableTotals(ActionHeaderExtension extension,

for (int[] row : total) {
_html.td("active", row[0]);
_html.td("max", row[1]);
if (row[1] >= 0) {
_html.td("max", row[1]);
} else {
_html.td("max");
}
_html.td("queued", row[2]);
}

Expand Down Expand Up @@ -141,7 +145,11 @@ private void printPoolActionRow(PoolCostEntry info,
_html.td(3, "integrated", "Integrated");
} else {
_html.td("active", row[0]);
_html.td("max", row[1]);
if (row[1] >= 0) {
_html.td("max", row[1]);
} else {
_html.td("max");
}
if (row[2] > 0) {
_html.td("queued", row[2]);
} else {
Expand Down Expand Up @@ -245,12 +253,12 @@ private int[][] decodePoolCostInfo(PoolCostInfo costInfo)

rows[1] = new int[3];
rows[1][0] = restore.getActive();
rows[1][1] = restore.getMaxActive();
rows[1][1] = -1;
rows[1][2] = restore.getQueued();

rows[2] = new int[3];
rows[2][0] = store.getActive();
rows[2][1] = store.getMaxActive();
rows[2][1] = -1;
rows[2][2] = store.getQueued();

if (p2pServer == null) {
Expand Down

0 comments on commit 38ec2c7

Please sign in to comment.