• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CounterType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setUp

import net.floodlightcontroller.debugcounter.IDebugCounterService.CounterType; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
    dc = new DebugCounter();
    S1 =       dc.registerCounter("switch", "01", "switch01",
                                  CounterType.ALWAYS_COUNT);
    S2 =       dc.registerCounter("switch", "02", "switch02",
                                  CounterType.ALWAYS_COUNT);
    S1_pi =    dc.registerCounter("switch", "01/pktin",
                                  "switch01-pktin",
                                  CounterType.ALWAYS_COUNT);
    S1_pi_d =  dc.registerCounter("switch", "01/pktin/drops",
                                  "switch01-pktin drops for all reasons",
                                  CounterType.ALWAYS_COUNT, "warn");
    S1_pi_e =  dc.registerCounter("switch", "01/pktin/err",
                                  "switch01-pktin errors",
                                  CounterType.ALWAYS_COUNT, "error", "snmp");
    S1_po =    dc.registerCounter("switch", "01/pktout",
                                  "switch01-pktout",
                                  CounterType.ALWAYS_COUNT);
    L_t =      dc.registerCounter("linkd", "tunnel",
                                  "tunnel links",
                                  CounterType.ALWAYS_COUNT);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:25,代码来源:DebugCounterTest.java


示例2: registerDebugCounters

import net.floodlightcontroller.debugcounter.IDebugCounterService.CounterType; //导入依赖的package包/类
private void registerDebugCounters(FloodlightModuleContext context)
        throws FloodlightModuleException {
    if (context != null) {
        try {
            counterHints = debugCounter.registerCounter(PACKAGE, "hints",
                                "Queued sync events processed",
                                CounterType.ALWAYS_COUNT);
            counterSentValues = debugCounter.registerCounter(PACKAGE, "sent-values",
                                "Values synced to remote node",
                                CounterType.ALWAYS_COUNT);
            counterReceivedValues = debugCounter.registerCounter(PACKAGE, "received-values",
                                "Values received from remote node",
                                CounterType.ALWAYS_COUNT);
            counterPuts = debugCounter.registerCounter(PACKAGE, "puts",
                                "Local puts to store",
                                CounterType.ALWAYS_COUNT);
            counterGets = debugCounter.registerCounter(PACKAGE, "gets",
                                "Local gets from store",
                                CounterType.ALWAYS_COUNT);
            counterIterators = debugCounter.registerCounter(PACKAGE, "iterators",
                                "Local iterators created over store",
                                CounterType.ALWAYS_COUNT);
            counterErrorRemote = debugCounter.registerCounter(PACKAGE, "error-remote",
                                "Number of errors sent from remote clients",
                                CounterType.ALWAYS_COUNT,
                                IDebugCounterService.CTR_MDATA_ERROR);
            counterErrorProcessing = debugCounter.registerCounter(PACKAGE,
                                "error-processing",
                                "Number of errors processing messages from remote clients",
                                CounterType.ALWAYS_COUNT,
                                IDebugCounterService.CTR_MDATA_ERROR);
        } catch (CounterException e) {
            throw new FloodlightModuleException(e.getMessage());
        }
    }

}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:38,代码来源:SyncManager.java


示例3: testCounterReregistry

import net.floodlightcontroller.debugcounter.IDebugCounterService.CounterType; //导入依赖的package包/类
@Test
public void testCounterReregistry() throws Exception {
    testCounterHierarchy();
    checkCounters(1, 2, 3, 10, 20, 100, 105);
    S1 =  dc.registerCounter("switch", "01", "switch01",
                             CounterType.ALWAYS_COUNT);
    checkCounters(0, 2, 3, 0, 0, 0, 0); // switch 1 counter re-setted
    assertEquals(0, S1.getCounterValue());
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:10,代码来源:DebugCounterTest.java


示例4: getCounterType

import net.floodlightcontroller.debugcounter.IDebugCounterService.CounterType; //导入依赖的package包/类
public CounterType getCounterType() {
    return counterType;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:4,代码来源:DebugCounterResource.java


示例5: testEnableDisableCounter

import net.floodlightcontroller.debugcounter.IDebugCounterService.CounterType; //导入依赖的package包/类
@Test
public void testEnableDisableCounter() throws Exception {
    testCounterHierarchy();
    IDebugCounter S1_pi_u, S1_fm, S1_fm_d;

    S1_pi_u =  dc.registerCounter("switch", "01/pktin/unknowns",
                                  "switch01-pktin unknowns",
                                  CounterType.COUNT_ON_DEMAND, "warn");
    dclist = dc.getCounterHierarchy("switch", "01/pktin");
    verifyCounters(dclist, 0L, 10L, 100L, 105L);
    S1_pi_u.updateCounterWithFlush(112);
    dclist = dc.getCounterHierarchy("switch", "01/pktin");
    verifyCounters(dclist, 0L, 10L, 100L, 105L);

    dc.enableCtrOnDemand("switch", "01/pktin/unknowns");
    dclist = dc.getCounterHierarchy("switch", "01/pktin");
    verifyCounters(dclist, 0L, 10L, 100L, 105L);
    dc.flushCounters(); // required for sync of thread-local store to global store
    S1_pi_u.updateCounterWithFlush(112);
    assertEquals(112L, S1_pi_u.getCounterValue());
    dclist = dc.getCounterHierarchy("switch", "01/pktin");
    verifyCounters(dclist, 10L, 100L, 105L, 112L);
    S1_pi_u.updateCounterWithFlush();
    dclist = dc.getCounterHierarchy("switch", "01/pktin");
    verifyCounters(dclist, 10L, 100L, 105L, 113L);

    dc.disableCtrOnDemand("switch", "01/pktin/unknowns");
    S1_pi_u.updateCounterWithFlush();
    S1_pi_u.updateCounterWithFlush();
    S1_pi_u.updateCounterWithFlush();
    dclist = dc.getCounterHierarchy("switch", "01/pktin");
    verifyCounters(dclist, 10L, 100L, 105L, 0L);

    //cannot disable ALWAYS_COUNT counter
    dc.disableCtrOnDemand("switch", "01/pktin/err");
    S1_pi_e.updateCounterWithFlush();
    dclist = dc.getCounterHierarchy("switch", "01/pktin");
    verifyCounters(dclist, 10L, 100L, 106L, 0L);

    //enable/disable counter inside hierarchy
    S1_fm =  dc.registerCounter("switch", "01/fm",
                                  "switch01-flow-mods",
                                  CounterType.COUNT_ON_DEMAND, "warn");
    S1_fm_d =  dc.registerCounter("switch", "01/fm/dup",
                                  "switch01- duplicate flow mods",
                                  CounterType.ALWAYS_COUNT, "warn");
    S1_fm.updateCounterWithFlush(8000);
    S1_fm_d.updateCounterWithFlush(5000);
    dclist = dc.getCounterHierarchy("switch", "01/fm");
    verifyCounters(dclist, 5000L, 0L);
    dc.enableCtrOnDemand("switch", "01/fm");
    dc.flushCounters();
    S1_fm.updateCounterWithFlush(8000);
    S1_fm_d.updateCounterWithFlush(5000);
    dclist = dc.getCounterHierarchy("switch", "01/fm");
    verifyCounters(dclist, 10000L, 8000L);
    dc.disableCtrOnDemand("switch", "01/fm");
    S1_fm.updateCounterWithFlush(8000);
    S1_fm_d.updateCounterWithFlush(5000);
    dclist = dc.getCounterHierarchy("switch", "01/fm");
    verifyCounters(dclist, 15000L, 0L);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:63,代码来源:DebugCounterTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BasicErrorController类代码示例发布时间:2022-05-23
下一篇:
Java AResultEntry类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap