Skip to content

Commit

Permalink
many: add diagnostic information about remote pool monitor
Browse files Browse the repository at this point in the history
Motivation:

Many dCache components use RemotePoolMonitor to provide fast access to
the information that PoolManager has about pools.  In some cases,
accessing information to help diagnose problems is difficult or
impossible.

Modification:

Add information to the 'info' admin command that describes the current
status of the RemotePoolMonitor.

Result:

Hopefully more information when diagnosing problems to do with
remote-pool-monitor.

Target: master
Require-notes: yes
Require-book: yes
Request: 3.2
Request: 3.1
Request: 3.0
Request: 2.16
Patch: https://rb.dcache.org/r/10492/
Acked-by: Tigran Mkrtchyan

Conflicts:
	modules/dcache/src/main/java/org/dcache/poolmanager/RemotePoolMonitor.java
  • Loading branch information
paulmillar committed Oct 10, 2017
1 parent b543bbe commit c89c0d0
Showing 1 changed file with 23 additions and 1 deletion.
Expand Up @@ -26,6 +26,7 @@
import org.springframework.remoting.RemoteConnectFailureException;
import org.springframework.remoting.RemoteProxyFailureException;

import java.io.PrintWriter;
import java.util.Collection;
import java.util.concurrent.TimeUnit;

Expand All @@ -39,12 +40,16 @@

import dmg.cells.nucleus.CellEvent;
import dmg.cells.nucleus.CellEventListener;
import dmg.cells.nucleus.CellEndpoint;
import dmg.cells.nucleus.CellInfo;
import dmg.cells.nucleus.CellInfoProvider;
import dmg.cells.nucleus.CellLifeCycleAware;
import dmg.cells.nucleus.CellMessageReceiver;
import dmg.cells.nucleus.CellRoute;

import org.dcache.cells.AbstractMessageCallback;
import org.dcache.cells.CellStub;
import org.dcache.util.TimeUtils;
import org.dcache.vehicles.FileAttributes;

import static org.dcache.util.MathUtils.addWithInfinity;
Expand All @@ -54,7 +59,7 @@
* PoolMonitor that delegates to a PoolMonitor obtained from pool manager.
*/
public class RemotePoolMonitor
implements PoolMonitor, CellLifeCycleAware, CellMessageReceiver, CellEventListener
implements PoolMonitor, CellLifeCycleAware, CellMessageReceiver, CellEventListener, CellInfoProvider
{
private static final Logger LOGGER = LoggerFactory.getLogger(RemotePoolMonitor.class);

Expand Down Expand Up @@ -102,6 +107,23 @@ public void routeDeleted(CellEvent ce)
{
}

public void getInfo(PrintWriter pw)
{
if (lastRefreshTime > 0) {
pw.println("last refreshed = " +
TimeUtils.relativeTimestamp(lastRefreshTime, System.currentTimeMillis()));

}
pw.println("refresh count = " + refreshCount);
pw.println("active refresh target = " + poolManagerStub);
}

public CellInfo getCellInfo(CellInfo info)
{
return info;
}


@Override
public synchronized void afterStart()
{
Expand Down

0 comments on commit c89c0d0

Please sign in to comment.