Class TopoUtils


  • public final class TopoUtils
    extends Object
    Utility methods for helping out with formatting data for the Topology View in the web client.
    • Method Detail

      • compactLinkString

        public static String compactLinkString​(Link link)
        Returns a compact identity for the given link, in the form used to identify links in the Topology View on the client.
        Parameters:
        link - link
        Returns:
        compact link identity
      • canonicalLinkKey

        public static LinkKey canonicalLinkKey​(Link link)
        Produces a canonical link key, that is, one that will match both a link and its inverse.
        Parameters:
        link - the link
        Returns:
        canonical key
      • formatBytes

        public static TopoUtils.ValueLabel formatBytes​(long bytes)
        Returns a value representing a count of bytes.
        Parameters:
        bytes - number of bytes
        Returns:
        value representing bytes
      • formatPacketRate

        public static TopoUtils.ValueLabel formatPacketRate​(long packets)
        Returns a value representing a count of packets per second.
        Parameters:
        packets - number of packets (per second)
        Returns:
        value representing packets per second
      • formatClippedBitRate

        public static TopoUtils.ValueLabel formatClippedBitRate​(long bytes)
        Returns a value representing a count of bits per second, (clipped to a maximum of 100 Gbps). Note that the input is bytes per second.
        Parameters:
        bytes - bytes per second
        Returns:
        value representing bits per second
      • formatFlows

        public static String formatFlows​(long flows)
        Returns human readable flow count, to be displayed as a label.
        Parameters:
        flows - number of flows
        Returns:
        formatted flow count