Class Statistics


  • public class Statistics
    extends java.lang.Object
    Class representing transfer statistics for a Tunnel instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isStale()
      Check if the statistics are stale, indicating the need for the Backend to update them.
      long peerRx​(Key peer)
      Get the received traffic (in bytes) for the Peer referenced by the provided Key
      Key[] peers()
      Get the list of peers being tracked by this instance.
      long peerTx​(Key peer)
      Get the transmitted traffic (in bytes) for the Peer referenced by the provided Key
      long totalRx()
      Get the total received traffic by all the peers being tracked by this instance
      long totalTx()
      Get the total transmitted traffic by all the peers being tracked by this instance
      • Methods inherited from class java.lang.Object

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

      • isStale

        public boolean isStale()
        Check if the statistics are stale, indicating the need for the Backend to update them.
        Returns:
        boolean indicating if the current statistics instance has stale values.
      • peerRx

        public long peerRx​(Key peer)
        Get the received traffic (in bytes) for the Peer referenced by the provided Key
        Parameters:
        peer - A Key representing a Peer.
        Returns:
        a long representing the number of bytes received by this peer.
      • peerTx

        public long peerTx​(Key peer)
        Get the transmitted traffic (in bytes) for the Peer referenced by the provided Key
        Parameters:
        peer - A Key representing a Peer.
        Returns:
        a long representing the number of bytes transmitted by this peer.
      • peers

        public Key[] peers()
        Get the list of peers being tracked by this instance.
        Returns:
        An array of Key instances representing WireGuard Peers
      • totalRx

        public long totalRx()
        Get the total received traffic by all the peers being tracked by this instance
        Returns:
        a long representing the number of bytes received by the peers being tracked.
      • totalTx

        public long totalTx()
        Get the total transmitted traffic by all the peers being tracked by this instance
        Returns:
        a long representing the number of bytes transmitted by the peers being tracked.