本文整理汇总了Java中org.onosproject.incubator.net.tunnel.TunnelStatistics类的典型用法代码示例。如果您正苦于以下问题:Java TunnelStatistics类的具体用法?Java TunnelStatistics怎么用?Java TunnelStatistics使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TunnelStatistics类属于org.onosproject.incubator.net.tunnel包,在下文中一共展示了TunnelStatistics类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildTunnelStatistics
import org.onosproject.incubator.net.tunnel.TunnelStatistics; //导入依赖的package包/类
/**
* Build a DefaultTunnelStatistics from a PcepTunnelStatistics.
*
* @param statistics statistics data from a PCEP tunnel
* @return TunnelStatistics
*/
private TunnelStatistics buildTunnelStatistics(PcepTunnelStatistics statistics) {
DefaultTunnelStatistics.Builder builder = new DefaultTunnelStatistics.Builder();
DefaultTunnelStatistics tunnelStatistics = builder.setBwUtilization(statistics.bandwidthUtilization())
.setPacketLossRatio(statistics.packetLossRate())
.setFlowDelay(statistics.flowDelay())
.setAlarms(statistics.alarms())
.build();
return tunnelStatistics;
}
示例2: handlePcepTunnelStatistics
import org.onosproject.incubator.net.tunnel.TunnelStatistics; //导入依赖的package包/类
@Override
public void handlePcepTunnelStatistics(PcepTunnelStatistics pcepTunnelStatistics) {
TunnelId id = getTunnelId(String.valueOf(pcepTunnelStatistics.id()));
TunnelStatistics tunnelStatistics = buildTunnelStatistics(pcepTunnelStatistics);
tunnelStatisticsMap.put(id, tunnelStatistics);
}