bookkeeper-common/src/main/java/org/apache/bookkeeper/common/stats/BroadCastStatsLogger.java [107:148]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public Counter getCounter(final String statName) {
            final Counter firstCounter = first.getCounter(statName);
            final Counter secondCounter = second.getCounter(statName);
            return new Counter() {
                @Override
                public void clear() {
                    firstCounter.clear();
                    secondCounter.clear();
                }

                @Override
                public void inc() {
                    firstCounter.inc();
                    secondCounter.inc();
                }

                @Override
                public void dec() {
                    firstCounter.dec();
                    secondCounter.dec();
                }

                @Override
                public void addCount(long l) {
                    firstCounter.addCount(l);
                    secondCounter.addCount(l);
                }

                @Override
                public void addLatency(long eventLatency, TimeUnit unit) {
                    long valueMillis = unit.toMillis(eventLatency);
                    firstCounter.addCount(valueMillis);
                    secondCounter.addCount(valueMillis);
                }

                @Override
                public Long get() {
                    // Eventually consistent.
                    return firstCounter.get();
                }
            };
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



stream/distributedlog/common/src/main/java/org/apache/distributedlog/common/stats/BroadCastStatsLogger.java [107:148]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public Counter getCounter(final String statName) {
            final Counter firstCounter = first.getCounter(statName);
            final Counter secondCounter = second.getCounter(statName);
            return new Counter() {
                @Override
                public void clear() {
                    firstCounter.clear();
                    secondCounter.clear();
                }

                @Override
                public void inc() {
                    firstCounter.inc();
                    secondCounter.inc();
                }

                @Override
                public void dec() {
                    firstCounter.dec();
                    secondCounter.dec();
                }

                @Override
                public void addCount(long l) {
                    firstCounter.addCount(l);
                    secondCounter.addCount(l);
                }

                @Override
                public void addLatency(long eventLatency, TimeUnit unit) {
                    long valueMillis = unit.toMillis(eventLatency);
                    firstCounter.addCount(valueMillis);
                    secondCounter.addCount(valueMillis);
                }

                @Override
                public Long get() {
                    // Eventually consistent.
                    return firstCounter.get();
                }
            };
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



