public final class FlowStatsUtils extends Object
FlowStatsUtils class is a collection of utility class methods for
flow statistics management.| Modifier and Type | Method and Description |
|---|---|
static FlowStatsHistory |
addNonPeriodic(FlowStatsHistory history,
FlowStatsRecord newRecord)
Add a non-periodic flow statistics record to the statistics history.
|
static FlowStatsHistory |
addPeriodic(FlowStatsHistory history,
Long sysTime,
org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.GenericStatistics gstats)
Add a periodic flow statistics record to the statistics history.
|
static String |
check(org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.GenericStatistics fstats)
Ensure that the given flow statistics contains valid values.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsInput |
createGetFlowStatsInput(SalNode snode)
Construct an RPC input which requests statistics information about all
VTN flow entries present in the given switch.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsInput |
createGetFlowStatsInput(VtnFlowEntry vfent)
Construct an RPC input which requests flow statistics for the given
VTN flow entry.
|
static String |
createTransactionKey(String nid,
BigInteger xid)
Create a key string which identifies the transaction for getting flow
statistics from switch.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.statistics.FlowStatistics> |
getIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId node,
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId flowId)
Create the instance identifier of the statistics information for the
given MD-SAL flow.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<FlowStatsHistory> |
getIdentifier(String name,
VtnDataFlowKey flowKey)
Create the instance identifier for the statistics history of the
given VTN data flow.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.statistics.FlowStatistics |
read(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId node,
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId flowId)
Read statistics information for the given MD-SAL flow.
|
static NavigableMap<Long,FlowStatsRecord> |
toNavigableMap(FlowStatsHistory history)
Put all the flow statistics records in the given statistics history
into a new navigable map.
|
public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<FlowStatsHistory> getIdentifier(String name, VtnDataFlowKey flowKey)
name - The name of the VTN.flowKey - A VtnDataFlowKey instance which contains the
target flow ID.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.statistics.FlowStatistics> getIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId node,
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId flowId)
node - The MD-SAL node identifier.flowId - The MD-SAL flow identifier.InstanceIdentifier instance.public static org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsInput createGetFlowStatsInput(VtnFlowEntry vfent)
vfent - The target VTN flow entry.GetFlowStatisticsInput instance.public static org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsInput createGetFlowStatsInput(SalNode snode)
Note that this method uses flow cookie to select VTN flow entries. So OpenFlow 1.0 switch will return all the flow entries when it receives an input returned by this method.
snode - A SalNode instance which specifies the target
switch.GetFlowStatisticsInput instance.public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.statistics.FlowStatistics read(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId node,
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId flowId)
throws VTNException
rtx - A ReadTransaction instance.node - The MD-SAL node identifier.flowId - The MD-SAL flow identifier.FlowStatistics instance if available.
null if not available.VTNException - An error occurred.public static String check(org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.GenericStatistics fstats)
fstats - A flow statistics to be checked.null if the given flow statistics is valid.
An error message if the given flow statistics is invalid.public static NavigableMap<Long,FlowStatsRecord> toNavigableMap(FlowStatsHistory history)
All statistics records are associated with its creation time in a returned map.
history - History of flow statistics.NavigableMap instance.public static FlowStatsHistory addPeriodic(FlowStatsHistory history, Long sysTime, org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.GenericStatistics gstats)
history - History of flow statistics.sysTime - The system time when the statistics is derived.gstats - A statistics record to be added.FlowStatsHistory instance.public static FlowStatsHistory addNonPeriodic(FlowStatsHistory history, FlowStatsRecord newRecord)
history - History of flow statistics.newRecord - A flow statistics record to be added.
Note that periodic flag in this record must be false.FlowStatsHistory instance if the statistics history
needs to be updated. Otherwise null.public static String createTransactionKey(String nid, BigInteger xid)
nid - A MD-SAL node identifier which specifies the switch.xid - A OpenFlow transaction ID.Copyright © 2018 OpenDaylight. All rights reserved.