X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fopenflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugin%2Fopenflow%2Finternal%2FOFStatisticsManager.java;h=bae49d511a2f853f61d428f0751ea7b231539831;hp=3c02c1762875eceb1ba226f8b333584af9b852bf;hb=7003730382163cfce52d89b0bd08491097a389dc;hpb=bcb16d1f4b1b1f2ac28553edb0aafc5ca770eff1 diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java index 3c02c17628..bae49d511a 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java @@ -155,6 +155,20 @@ IInventoryShimExternalListener, CommandProvider { } } + private short getStatsQueueSize() { + String statsQueueSizeStr = System.getProperty("of.statsQueueSize"); + short statsQueueSize = INITIAL_SIZE; + if (statsQueueSizeStr != null) { + try { + statsQueueSize = Short.parseShort(statsQueueSizeStr); + if (statsQueueSize <= 0) { + statsQueueSize = INITIAL_SIZE; + } + } catch (Exception e) { + } + } + return statsQueueSize; + } /** * Function called by the dependency manager when all the required * dependencies are satisfied @@ -166,8 +180,8 @@ IInventoryShimExternalListener, CommandProvider { portStatistics = new ConcurrentHashMap>(); tableStatistics = new ConcurrentHashMap>(); dummyList = new ArrayList(1); + pendingStatsRequests = new LinkedBlockingQueue(getStatsQueueSize()); statisticsTimerTicks = new ConcurrentHashMap(INITIAL_SIZE); - pendingStatsRequests = new LinkedBlockingQueue(INITIAL_SIZE); switchPortStatsUpdated = new LinkedBlockingQueue(INITIAL_SIZE); switchSupportsVendorExtStats = new ConcurrentHashMap(INITIAL_SIZE); txRates = new HashMap>(INITIAL_SIZE);