Package org.jitsi.impl.neomedia.stats
Class AbstractTrackStats
- java.lang.Object
-
- org.jitsi.impl.neomedia.stats.AbstractTrackStats
-
- All Implemented Interfaces:
TrackStats
- Direct Known Subclasses:
ReceiveTrackStatsImpl,SendTrackStatsImpl
public abstract class AbstractTrackStats extends Object implements TrackStats
Media stream statistics per send or receive SSRC.- Author:
- Damian Minkov, Boris Grozev
-
-
Field Summary
Fields Modifier and Type Field Description protected org.jitsi.utils.stats.RateStatisticsbitrateThe bitrate.protected AtomicLongbytesThe total number of bytes.protected AtomicLongbytesNotRetransmittedNumber of bytes for packets which were requested and found in the cache, but were intentionally not retransmitted.protected AtomicLongbytesRetransmittedNumber of bytes retransmitted.protected org.jitsi.utils.stats.RateStatisticspacketRateThe packet rate.protected AtomicLongpacketsThe total number of RTP packets.protected AtomicLongpacketsMissingFromCacheThe number of packets for which retransmission was requested, but they were missing from the cache.protected AtomicLongpacketsNotRetransmittedNumber of packets which were requested and found in the cache, but were intentionally not retransmitted.protected AtomicLongpacketsRetransmittedNumber of packets retransmitted.-
Fields inherited from interface org.jitsi.service.neomedia.stats.TrackStats
JITTER_UNSET
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetBitrate()longgetBytes()longgetBytesNotRetransmitted()Gets the number of bytes for packets which were requested and found in the cache, but were intentionally not retransmitted.longgetBytesRetransmitted()Gets the number of bytes retransmitted.longgetCurrentBytes()longgetCurrentPackets()longgetInterval()doublegetJitter()longgetPacketRate()longgetPackets()longgetPacketsMissingFromCache()Gets the number of packets for which retransmission was requested, but they were missing from the cache.longgetPacketsNotRetransmitted()Gets the number of packets which were requested and found in the cache, but were intentionally not retransmitted.longgetPacketsRetransmitted()Gets the number of packets retransmitted.longgetRtt()longgetSSRC()protected voidpacketProcessed(int length, long now, boolean rtp)Notifies this instance that a packet with a given length was processed (i.e.protected voidrtpPacketNotRetransmitted(long length)Notifies this instance that an RTP packet with a given length was retransmitted.protected voidrtpPacketRetransmitted(long length)Notifies this instance that an RTP packet with a given length was not retransmitted (that is, the remote endpoint requested it, and it was found in the local cache, but it was not retransmitted).protected voidsetJitter(double jitter)Sets the last jitter that was sent/received.protected voidsetRtt(long rtt)Setsrttto a specific value in milliseconds.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jitsi.service.neomedia.stats.TrackStats
getLossRate
-
-
-
-
Field Detail
-
bytes
protected final AtomicLong bytes
The total number of bytes.
-
packets
protected final AtomicLong packets
The total number of RTP packets. This excludes RTCP packets, because the value is used to calculate the number of lost RTP packets.
-
bytesRetransmitted
protected final AtomicLong bytesRetransmitted
Number of bytes retransmitted.
-
bytesNotRetransmitted
protected final AtomicLong bytesNotRetransmitted
Number of bytes for packets which were requested and found in the cache, but were intentionally not retransmitted.
-
packetsRetransmitted
protected final AtomicLong packetsRetransmitted
Number of packets retransmitted.
-
packetsNotRetransmitted
protected final AtomicLong packetsNotRetransmitted
Number of packets which were requested and found in the cache, but were intentionally not retransmitted.
-
packetsMissingFromCache
protected final AtomicLong packetsMissingFromCache
The number of packets for which retransmission was requested, but they were missing from the cache.
-
bitrate
protected org.jitsi.utils.stats.RateStatistics bitrate
The bitrate.
-
packetRate
protected org.jitsi.utils.stats.RateStatistics packetRate
The packet rate.
-
-
Method Detail
-
getSSRC
public long getSSRC()
- Specified by:
getSSRCin interfaceTrackStats- Returns:
- the SSRC associated with this
TrackStats.
-
packetProcessed
protected void packetProcessed(int length, long now, boolean rtp)Notifies this instance that a packet with a given length was processed (i.e. sent or received).- Parameters:
length- the length of the packet.now- the time at which the packet was processed (passed in order to avoid callingSystem.currentTimeMillis()).rtp- whether the packet is an RTP or RTCP packet.
-
getJitter
public double getJitter()
- Specified by:
getJitterin interfaceTrackStats- Returns:
- the jitter in milliseconds.
-
getRtt
public long getRtt()
- Specified by:
getRttin interfaceTrackStats- Returns:
- the round trip time in milliseconds.
-
getBytes
public long getBytes()
- Specified by:
getBytesin interfaceTrackStats- Returns:
- the total number of bytes.
-
getPackets
public long getPackets()
- Specified by:
getPacketsin interfaceTrackStats- Returns:
- the total number of packets.
-
getBitrate
public long getBitrate()
- Specified by:
getBitratein interfaceTrackStats- Returns:
- the current bitrate in bits per second.
-
getPacketRate
public long getPacketRate()
- Specified by:
getPacketRatein interfaceTrackStats- Returns:
- the current packet rate in packets per second.
-
getCurrentBytes
public long getCurrentBytes()
- Specified by:
getCurrentBytesin interfaceTrackStats- Returns:
- the number of bytes in the last interval.
-
getCurrentPackets
public long getCurrentPackets()
- Specified by:
getCurrentPacketsin interfaceTrackStats- Returns:
- the number of packets in the last interval.
-
getInterval
public long getInterval()
- Specified by:
getIntervalin interfaceTrackStats- Returns:
- the interval length in milliseconds over which
TrackStats.getCurrentBytes()andTrackStats.getCurrentPackets()operate.
-
setJitter
protected void setJitter(double jitter)
Sets the last jitter that was sent/received.- Parameters:
jitter- the new value to set on this instance as the last sent/received jitter (in milliseconds).
-
setRtt
protected void setRtt(long rtt)
Setsrttto a specific value in milliseconds.
-
getBytesRetransmitted
public long getBytesRetransmitted()
Gets the number of bytes retransmitted.- Specified by:
getBytesRetransmittedin interfaceTrackStats- Returns:
- the number of bytes retransmitted.
-
getBytesNotRetransmitted
public long getBytesNotRetransmitted()
Gets the number of bytes for packets which were requested and found in the cache, but were intentionally not retransmitted.- Specified by:
getBytesNotRetransmittedin interfaceTrackStats- Returns:
- the number of bytes for packets which were requested and found in the cache, but were intentionally not retransmitted.
-
getPacketsRetransmitted
public long getPacketsRetransmitted()
Gets the number of packets retransmitted.- Specified by:
getPacketsRetransmittedin interfaceTrackStats- Returns:
- the number of packets retransmitted.
-
getPacketsNotRetransmitted
public long getPacketsNotRetransmitted()
Gets the number of packets which were requested and found in the cache, but were intentionally not retransmitted.- Specified by:
getPacketsNotRetransmittedin interfaceTrackStats- Returns:
- the number of packets which were requested and found in the cache, but were intentionally not retransmitted.
-
getPacketsMissingFromCache
public long getPacketsMissingFromCache()
Gets the number of packets for which retransmission was requested, but they were missing from the cache.- Specified by:
getPacketsMissingFromCachein interfaceTrackStats- Returns:
- the number of packets for which retransmission was requested, but they were missing from the cache.
-
rtpPacketRetransmitted
protected void rtpPacketRetransmitted(long length)
Notifies this instance that an RTP packet with a given length was not retransmitted (that is, the remote endpoint requested it, and it was found in the local cache, but it was not retransmitted).- Parameters:
length- the length in bytes of the packet.
-
rtpPacketNotRetransmitted
protected void rtpPacketNotRetransmitted(long length)
Notifies this instance that an RTP packet with a given length was retransmitted.- Parameters:
length- the length in bytes of the packet.
-
-