public final class TopoUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BITS_UNIT |
static String |
BYTES_UNIT |
static String |
GBITS_UNIT |
static String |
GBYTES_UNIT |
static double |
GIGA |
static String |
KBITS_UNIT |
static String |
KBYTES_UNIT |
static double |
KILO |
static String |
MBITS_UNIT |
static String |
MBYTES_UNIT |
static double |
MEGA |
| Modifier and Type | Method and Description |
|---|---|
static LinkKey |
canonicalLinkKey(Link link)
Produces a canonical link key, that is, one that will match both a link
and its inverse.
|
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.
|
static String |
formatBitRate(long bytes)
Returns human readable bit rate, to be displayed as a label.
|
static String |
formatBytes(long bytes)
Returns human readable count of bytes, to be displayed as a label.
|
static String |
formatFlows(long flows)
Returns human readable flow count, to be displayed as a label.
|
public static final double KILO
public static final double MEGA
public static final double GIGA
public static final String GBITS_UNIT
public static final String MBITS_UNIT
public static final String KBITS_UNIT
public static final String BITS_UNIT
public static final String GBYTES_UNIT
public static final String MBYTES_UNIT
public static final String KBYTES_UNIT
public static final String BYTES_UNIT
public static String compactLinkString(Link link)
link - linkpublic static LinkKey canonicalLinkKey(Link link)
link - the linkpublic static String formatBytes(long bytes)
bytes - number of bytespublic static String formatBitRate(long bytes)
bytes - bytes per secondpublic static String formatFlows(long flows)
flows - number of flows