当前位置: 首页>>代码示例>>Java>>正文


Java SummaryFlowEntryWithLoad类代码示例

本文整理汇总了Java中org.onosproject.net.statistic.SummaryFlowEntryWithLoad的典型用法代码示例。如果您正苦于以下问题:Java SummaryFlowEntryWithLoad类的具体用法?Java SummaryFlowEntryWithLoad怎么用?Java SummaryFlowEntryWithLoad使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SummaryFlowEntryWithLoad类属于org.onosproject.net.statistic包,在下文中一共展示了SummaryFlowEntryWithLoad类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadSummary

import org.onosproject.net.statistic.SummaryFlowEntryWithLoad; //导入依赖的package包/类
@Override
public Map<ConnectPoint, SummaryFlowEntryWithLoad> loadSummary(Device device) {
    checkPermission(STATISTIC_READ);

    Map<ConnectPoint, SummaryFlowEntryWithLoad> summaryLoad = new TreeMap<>(CONNECT_POINT_COMPARATOR);

    if (device == null) {
        return summaryLoad;
    }

    List<Port> ports = new ArrayList<>(deviceService.getPorts(device.id()));

    for (Port port : ports) {
        ConnectPoint cp = new ConnectPoint(device.id(), port.number());
        SummaryFlowEntryWithLoad sfe = loadSummaryPortInternal(cp);
        summaryLoad.put(cp, sfe);
    }

    return summaryLoad;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:FlowStatisticManager.java

示例2: loadSummary

import org.onosproject.net.statistic.SummaryFlowEntryWithLoad; //导入依赖的package包/类
@Override
public Map<ConnectPoint, SummaryFlowEntryWithLoad> loadSummary(Device device) {
    checkPermission(STATISTIC_READ);

    Map<ConnectPoint, SummaryFlowEntryWithLoad> summaryLoad =
                                    new TreeMap<>(Comparators.CONNECT_POINT_COMPARATOR);

    if (device == null) {
        return summaryLoad;
    }

    List<Port> ports = new ArrayList<>(deviceService.getPorts(device.id()));

    for (Port port : ports) {
        ConnectPoint cp = new ConnectPoint(device.id(), port.number());
        SummaryFlowEntryWithLoad sfe = loadSummaryPortInternal(cp);
        summaryLoad.put(cp, sfe);
    }

    return summaryLoad;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:22,代码来源:FlowStatisticManager.java

示例3: printPortSummaryLoad

import org.onosproject.net.statistic.SummaryFlowEntryWithLoad; //导入依赖的package包/类
private void printPortSummaryLoad(ConnectPoint cp, SummaryFlowEntryWithLoad summaryFlowLoad) {
    print("  deviceId/Port=%s/%s, Total=%s, Immediate=%s, Short=%s, Mid=%s, Long=%s, Unknown=%s",
            cp.elementId(),
            cp.port(),
            summaryFlowLoad.totalLoad().isValid() ? summaryFlowLoad.totalLoad() : "Load{rate=0, NOT VALID}",
            summaryFlowLoad.immediateLoad().isValid() ? summaryFlowLoad.immediateLoad() : "Load{rate=0, NOT VALID}",
            summaryFlowLoad.shortLoad().isValid() ? summaryFlowLoad.shortLoad() : "Load{rate=0, NOT VALID}",
            summaryFlowLoad.midLoad().isValid() ? summaryFlowLoad.midLoad() : "Load{rate=0, NOT VALID}",
            summaryFlowLoad.longLoad().isValid() ? summaryFlowLoad.longLoad() : "Load{rate=0, NOT VALID}",
            summaryFlowLoad.unknownLoad().isValid() ? summaryFlowLoad.unknownLoad() : "Load{rate=0, NOT VALID}");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:12,代码来源:GetFlowStatistics.java

示例4: loadSummaryPortInternal

import org.onosproject.net.statistic.SummaryFlowEntryWithLoad; //导入依赖的package包/类
private SummaryFlowEntryWithLoad loadSummaryPortInternal(ConnectPoint cp) {
    checkPermission(STATISTIC_READ);

    Set<FlowEntry> currentStats;
    Set<FlowEntry> previousStats;

    TypedStatistics typedStatistics;
    synchronized (flowStatisticStore) {
         currentStats = flowStatisticStore.getCurrentFlowStatistic(cp);
        if (currentStats == null) {
            return new SummaryFlowEntryWithLoad(cp, new DefaultLoad());
        }
        previousStats = flowStatisticStore.getPreviousFlowStatistic(cp);
        if (previousStats == null) {
            return new SummaryFlowEntryWithLoad(cp, new DefaultLoad());
        }
        // copy to local flow entry
        typedStatistics = new TypedStatistics(currentStats, previousStats);

        // Check for validity of this stats data
        checkLoadValidity(currentStats, previousStats);
    }

    // current and previous set is not empty!
    Set<FlowEntry> currentSet = typedStatistics.current();
    Set<FlowEntry> previousSet = typedStatistics.previous();
    Load totalLoad = new DefaultLoad(aggregateBytesSet(currentSet), aggregateBytesSet(previousSet),
            TypedFlowEntryWithLoad.avgPollInterval());

    Map<FlowRule, TypedStoredFlowEntry> currentMap;
    Map<FlowRule, TypedStoredFlowEntry> previousMap;

    currentMap = typedStatistics.currentImmediate();
    previousMap = typedStatistics.previousImmediate();
    Load immediateLoad = new DefaultLoad(aggregateBytesMap(currentMap), aggregateBytesMap(previousMap),
            TypedFlowEntryWithLoad.shortPollInterval());

    currentMap = typedStatistics.currentShort();
    previousMap = typedStatistics.previousShort();
    Load shortLoad = new DefaultLoad(aggregateBytesMap(currentMap), aggregateBytesMap(previousMap),
            TypedFlowEntryWithLoad.shortPollInterval());

    currentMap = typedStatistics.currentMid();
    previousMap = typedStatistics.previousMid();
    Load midLoad = new DefaultLoad(aggregateBytesMap(currentMap), aggregateBytesMap(previousMap),
            TypedFlowEntryWithLoad.midPollInterval());

    currentMap = typedStatistics.currentLong();
    previousMap = typedStatistics.previousLong();
    Load longLoad = new DefaultLoad(aggregateBytesMap(currentMap), aggregateBytesMap(previousMap),
            TypedFlowEntryWithLoad.longPollInterval());

    currentMap = typedStatistics.currentUnknown();
    previousMap = typedStatistics.previousUnknown();
    Load unknownLoad = new DefaultLoad(aggregateBytesMap(currentMap), aggregateBytesMap(previousMap),
            TypedFlowEntryWithLoad.avgPollInterval());

    return new SummaryFlowEntryWithLoad(cp, totalLoad, immediateLoad, shortLoad, midLoad, longLoad, unknownLoad);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:60,代码来源:FlowStatisticManager.java

示例5: loadSummaryPortInternal

import org.onosproject.net.statistic.SummaryFlowEntryWithLoad; //导入依赖的package包/类
private SummaryFlowEntryWithLoad loadSummaryPortInternal(ConnectPoint cp) {
    checkPermission(STATISTIC_READ);

    Set<FlowEntry> currentStats;
    Set<FlowEntry> previousStats;

    TypedStatistics typedStatistics;
    synchronized (statisticStore) {
         currentStats = statisticStore.getCurrentStatistic(cp);
        if (currentStats == null) {
            return new SummaryFlowEntryWithLoad(cp, new DefaultLoad());
        }
        previousStats = statisticStore.getPreviousStatistic(cp);
        if (previousStats == null) {
            return new SummaryFlowEntryWithLoad(cp, new DefaultLoad());
        }
        // copy to local flow entry
        typedStatistics = new TypedStatistics(currentStats, previousStats);

        // Check for validity of this stats data
        checkLoadValidity(currentStats, previousStats);
    }

    // current and previous set is not empty!
    Set<FlowEntry> currentSet = typedStatistics.current();
    Set<FlowEntry> previousSet = typedStatistics.previous();
    PollInterval pollIntervalInstance = PollInterval.getInstance();

    // We assume that default pollInterval is flowPollFrequency in case adaptiveFlowSampling is true or false
    Load totalLoad = new DefaultLoad(aggregateBytesSet(currentSet), aggregateBytesSet(previousSet),
                                     pollIntervalInstance.getPollInterval());

    Map<FlowRule, FlowEntry> currentMap;
    Map<FlowRule, FlowEntry> previousMap;

    currentMap = typedStatistics.currentImmediate();
    previousMap = typedStatistics.previousImmediate();
    Load immediateLoad = new DefaultLoad(aggregateBytesMap(currentMap), aggregateBytesMap(previousMap),
                                         pollIntervalInstance.getPollInterval());

    currentMap = typedStatistics.currentShort();
    previousMap = typedStatistics.previousShort();
    Load shortLoad = new DefaultLoad(aggregateBytesMap(currentMap), aggregateBytesMap(previousMap),
                                     pollIntervalInstance.getPollInterval());

    currentMap = typedStatistics.currentMid();
    previousMap = typedStatistics.previousMid();
    Load midLoad = new DefaultLoad(aggregateBytesMap(currentMap), aggregateBytesMap(previousMap),
                                   pollIntervalInstance.getMidPollInterval());

    currentMap = typedStatistics.currentLong();
    previousMap = typedStatistics.previousLong();
    Load longLoad = new DefaultLoad(aggregateBytesMap(currentMap), aggregateBytesMap(previousMap),
                                    pollIntervalInstance.getLongPollInterval());

    currentMap = typedStatistics.currentUnknown();
    previousMap = typedStatistics.previousUnknown();
    Load unknownLoad = new DefaultLoad(aggregateBytesMap(currentMap), aggregateBytesMap(previousMap),
                                       pollIntervalInstance.getPollInterval());

    return new SummaryFlowEntryWithLoad(cp, totalLoad, immediateLoad, shortLoad, midLoad, longLoad, unknownLoad);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:63,代码来源:FlowStatisticManager.java


注:本文中的org.onosproject.net.statistic.SummaryFlowEntryWithLoad类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。