@Override public Statistics createAtomicStatistics(StatisticsType type, String textId) { return createAtomicStatistics(type, textId, 1); }
@Override public Statistics createStatistics(StatisticsType type) { return createStatistics(type, null, 1); }
private synchronized ConnectionStats getStats(ServerLocation location) { ConnectionStats stats = statMap.get(location); if (stats == null) { String statName = poolName + "-" + location.toString(); PoolImpl pool = (PoolImpl) PoolManager.find(this.poolName); if (pool != null) { if (pool.getGatewaySender() != null) { stats = new ConnectionStats(new DummyStatisticsFactory(), statName, this.poolStats/* , this.gatewayStats */); } } if (stats == null) { stats = new ConnectionStats(ds, statName, this.poolStats/* * , this.gatewayStats */); } statMap.put(location, stats); } return stats; }
private void createGatewaySender() { // Mock gateway sender this.sender = ParallelGatewaySenderHelper.createGatewaySender(this.cache); when(this.queueRegion.getParallelGatewaySender()).thenReturn(this.sender); when(this.sender.getQueues()).thenReturn(null); when(this.sender.getDispatcherThreads()).thenReturn(1); stats = new GatewaySenderStats(new DummyStatisticsFactory(), "ln"); when(this.sender.getStatistics()).thenReturn(stats); }
factory = new DummyStatisticsFactory(); } else { factory = this.getCache().getDistributedSystem();
@Override public Statistics createAtomicStatistics(StatisticsType type) { return createAtomicStatistics(type, null, 1); }
@Override public Statistics createStatistics(StatisticsType type, String textId) { return createStatistics(type, textId, 1); }
@Test public void initializeStatistics() { ProtobufProtocolService service = new ProtobufProtocolService(); service.initializeStatistics("first", new DummyStatisticsFactory()); ClientStatistics firstStatistics = service.getStatistics(); service.initializeStatistics("second", new DummyStatisticsFactory()); ClientStatistics secondStatistics = service.getStatistics(); assertEquals(firstStatistics, secondStatistics); } }
statFactory = new DummyStatisticsFactory(); } else { statFactory = this.dsys;