public final class TopoUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TopoUtils.Magnitude
Enumeration of magnitudes.
|
static class |
TopoUtils.ValueLabel
Encapsulates a value to be used as a label.
|
Modifier and Type | Field and Description |
---|---|
static String |
BITS_UNIT |
static String |
BYTES_UNIT |
static double |
N_GIGA |
static double |
N_KILO |
static double |
N_MEGA |
static String |
PACKETS_UNIT |
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 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 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.
|
public static final double N_KILO
public static final double N_MEGA
public static final double N_GIGA
public static final String BITS_UNIT
public static final String BYTES_UNIT
public static final String PACKETS_UNIT
public static String compactLinkString(Link link)
link
- linkpublic static LinkKey canonicalLinkKey(Link link)
link
- the linkpublic static TopoUtils.ValueLabel formatBytes(long bytes)
bytes
- number of bytespublic static TopoUtils.ValueLabel formatPacketRate(long packets)
packets
- number of packets (per second)public static TopoUtils.ValueLabel formatClippedBitRate(long bytes)
bytes
- bytes per secondpublic static String formatFlows(long flows)
flows
- number of flows