Class TopoUtils


  • public final class TopoUtils
    extends java.lang.Object
    Utility methods for helping out with formatting data for the Topology View in the web client.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TopoUtils.Magnitude
      Enumeration of magnitudes.
      static class  TopoUtils.ValueLabel
      Encapsulates a value to be used as a label.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static LinkKey canonicalLinkKey​(Link link)
      Produces a canonical link key, that is, one that will match both a link and its inverse.
      static java.lang.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.
      static TopoUtils.ValueLabel formatBytes​(long bytes)
      Returns a value representing a count of bytes.
      static TopoUtils.ValueLabel formatClippedBitRate​(long bytes)
      Returns a value representing a count of bits per second, (clipped to a maximum of 100 Gbps).
      static java.lang.String formatFlows​(long flows)
      Returns human readable flow count, to be displayed as a label.
      static TopoUtils.ValueLabel formatPacketRate​(long packets)
      Returns a value representing a count of packets per second.
      • Methods inherited from class java.lang.Object

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

      • compactLinkString

        public static java.lang.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 java.lang.String formatFlows​(long flows)
        Returns human readable flow count, to be displayed as a label.
        Parameters:
        flows - number of flows
        Returns:
        formatted flow count