public final class TopoUtils
extends java.lang.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 java.lang.String |
BITS_UNIT |
static java.lang.String |
BYTES_UNIT |
static double |
N_GIGA |
static double |
N_KILO |
static double |
N_MEGA |
static java.lang.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 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.
|
public static final double N_KILO
public static final double N_MEGA
public static final double N_GIGA
public static final java.lang.String BITS_UNIT
public static final java.lang.String BYTES_UNIT
public static final java.lang.String PACKETS_UNIT
public static java.lang.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 java.lang.String formatFlows(long flows)
flows
- number of flows