- java.lang.Object
-
- com.pervasive.datarush.ports.physical.PortSnapshot
-
- All Implemented Interfaces:
PortStatistics
,Serializable
- Direct Known Subclasses:
InputSnapshot
,OutputSnapshot
public abstract class PortSnapshot extends Object implements PortStatistics, Serializable
A snapshot of run-time statistics for a dataflow port. The snapshot can be for either an input or output port. Only those statistics shared by both directions are available; additional statistics are available from the subclasses.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<PortSnapshot>
asSnapshots(Collection<? extends PortStatistics> ports)
Converts a list of statistics into snapshots.long
getBatchCount()
Gets the accumulated count of token batches processed by the port.long
getDataDuration()
Gets the amount of time data has been flowing through the port, in milliseconds.long
getEODInstant()
Gets the time at which EOD was written/read on the port.long
getFirstBatchInstant()
Gets the time at which the first batch was written/read on the port.String
getName()
Gets the user-provided label associated with port.PortStatus
getState()
Gets the current state of the port.long
getTokenCount()
Gets the accumulated count of tokens processed by the port.TokenType
getType()
Gets the type of tokens handled by the port.long
getWaitCount()
Get the number of times the port entered a wait state.long
getWaitDuration()
Gets the total amount of time the port has spent in a wait state blocked by another process.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.pervasive.datarush.ports.physical.PortStatistics
getSnapshot
-
-
-
-
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 interfacePortStatistics
- 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 interfacePortStatistics
- Returns:
- a description of the data type
-
getState
public PortStatus getState()
Gets the current state of the port.- Specified by:
getState
in interfacePortStatistics
- Returns:
- the port state
-
getBatchCount
public long getBatchCount()
Gets the accumulated count of token batches processed by the port.- Specified by:
getBatchCount
in interfacePortStatistics
- 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 interfacePortStatistics
- 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 interfacePortStatistics
- 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 interfacePortStatistics
- 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 interfacePortStatistics
- 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 interfacePortStatistics
- 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 interfacePortStatistics
- 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
-
-