Class DataPortalActivityRegistry

java.lang.Object
ecmwf.ecpds.master.DataPortalActivityRegistry

public final class DataPortalActivityRegistry extends Object
The Class DataPortalActivityRegistry. In-memory, MasterServer-side registry deriving a live "current throughput" figure for the Data Portal (the FTP/HTTP/SFTP/S3/WebDAV interface used directly by IncomingUsers, as opposed to the Dissemination/Acquisition traffic between a DataMover and a Destination Host already tracked by LiveTransferRegistry). Fed by MasterServer.updateIncomingConnectionIds, which every DataMover calls roughly every couple of seconds (more often while a connection's counters are actively changing) with its current list of open IncomingConnections.

Each IncomingConnection carries cumulative (not incremental) bytesIn/bytesOut counters for the lifetime of the connection, so - exactly like LiveTransferRegistry's internal byte-delta tracking does for individual DataFile transfers - this class keeps the last known cumulative value per connection (keyed by DataMover name + connection id, since connection ids are only guaranteed unique within a single DataMover) and adds the incremental delta to a short rolling window, whose average rate is exposed via getBytesInPerSecond() / getBytesOutPerSecond(). A short (few-second) window is used - rather than the 24h buckets used for the transferred-bytes total - since this is meant to feel like a live speedometer, not a daily total.

  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets the current Data Portal bytes-in/sec rate (uploads from IncomingUsers into OpenECPDS), averaged over the last rolling window (a few seconds).
    double
    Gets the current Data Portal bytes-out/sec rate (downloads by IncomingUsers from OpenECPDS), averaged over the last rolling window (a few seconds).
    Gets the singleton instance.
    void
    recordConnections(String serverName, List<IncomingConnection> connections)
    Records a freshly received list of currently open incoming connections for a single DataMover, deriving the incremental bytes transferred since the last call for each connection and folding it into the current rolling window.
    void
    removeServer(String serverName)
    Drops all per-connection tracking state for a DataMover that is no longer connected, so it does not linger forever in _lastKnownByServer.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getInstance

      public static DataPortalActivityRegistry getInstance()
      Gets the singleton instance.
      Returns:
      the instance
    • recordConnections

      public void recordConnections(String serverName, List<IncomingConnection> connections)
      Records a freshly received list of currently open incoming connections for a single DataMover, deriving the incremental bytes transferred since the last call for each connection and folding it into the current rolling window. Connections no longer present in the list (i.e. closed since the last call) are pruned from the per-DataMover tracking map; any bytes they carried up to their last reported snapshot were already accounted for incrementally as they occurred, so nothing is lost by dropping them now.
      Parameters:
      serverName - the DataMover name
      connections - the currently open incoming connections on that DataMover, or null/empty if none
    • removeServer

      public void removeServer(String serverName)
      Drops all per-connection tracking state for a DataMover that is no longer connected, so it does not linger forever in _lastKnownByServer.
      Parameters:
      serverName - the DataMover name
    • getBytesInPerSecond

      public double getBytesInPerSecond()
      Gets the current Data Portal bytes-in/sec rate (uploads from IncomingUsers into OpenECPDS), averaged over the last rolling window (a few seconds).
      Returns:
      the current bytes-in/sec rate
    • getBytesOutPerSecond

      public double getBytesOutPerSecond()
      Gets the current Data Portal bytes-out/sec rate (downloads by IncomingUsers from OpenECPDS), averaged over the last rolling window (a few seconds).
      Returns:
      the current bytes-out/sec rate