Class PortSnapshot

    • Method Detail

      • getName

        public String getName()
        Gets the user-provided label associated with port. This is the name which was given when the port was created.
        Specified by:
        getName in interface PortStatistics
        Returns:
        the user-assigned name of the port
      • getType

        public TokenType getType()
        Gets the type of tokens handled by the port.
        Specified by:
        getType in interface PortStatistics
        Returns:
        a description of the data type
      • getBatchCount

        public long getBatchCount()
        Gets the accumulated count of token batches processed by the port.
        Specified by:
        getBatchCount in interface PortStatistics
        Returns:
        the total number of token batches processed
      • getTokenCount

        public long getTokenCount()
        Gets the accumulated count of tokens processed by the port.
        Specified by:
        getTokenCount in interface PortStatistics
        Returns:
        the total number of tokens processed
      • getWaitCount

        public long getWaitCount()
        Get the number of times the port entered a wait state. A wait state is entered when a writer attempts to write to a full queue or a reader attempts to read from an empty queue.
        Specified by:
        getWaitCount in interface PortStatistics
        Returns:
        the accumulated number of waits
      • getWaitDuration

        public long getWaitDuration()
        Gets the total amount of time the port has spent in a wait state blocked by another process.
        Specified by:
        getWaitDuration in interface PortStatistics
        Returns:
        milliseconds spent in a wait state
      • getFirstBatchInstant

        public long getFirstBatchInstant()
        Description copied from interface: PortStatistics
        Gets the time at which the first batch was written/read on the port.
        Specified by:
        getFirstBatchInstant in interface PortStatistics
        Returns:
        the time stamp, expressed as milliseconds since epoch, of the start of execution. If the first batch has not yet appeared, LONG.MIN_VALUE.
      • getEODInstant

        public long getEODInstant()
        Description copied from interface: PortStatistics
        Gets the time at which EOD was written/read on the port.
        Specified by:
        getEODInstant in interface PortStatistics
        Returns:
        the time stamp, expressed as milliseconds since epoch, of the start of execution. If EOD has not yet appeared, LONG.MIN_VALUE.
      • getDataDuration

        public long getDataDuration()
        Description copied from interface: PortStatistics
        Gets the amount of time data has been flowing through the port, in milliseconds. This is measured by wall clock; that is, this is how much time has passed since the moment the first batch was observed until either the moment EOD was observed or the current time, whichever is earlier.
        Specified by:
        getDataDuration in interface PortStatistics
        Returns:
        the duration of the data flow, in milliseconds. If the first batch has not yet been seen, 0.
      • asSnapshots

        public static List<PortSnapshot> asSnapshots​(Collection<? extends PortStatistics> ports)
        Converts a list of statistics into snapshots.
        Parameters:
        ports - live port statistics to capture
        Returns:
        snapshots of the specified ports