Package org.apache.sirona.counters

Examples of org.apache.sirona.counters.OptimizedStatistics


            if (called == 3 || called == -1) {
                final DefaultCounter defaultCounter = DefaultCounter.class.cast(counter);
                final Lock lock = defaultCounter.getLock().writeLock();
                lock.lock();
                try {
                    final OptimizedStatistics statistics = defaultCounter.getStatistics();
                    max = statistics.getMax();
                    sum = statistics.getSum();
                    hits = statistics.getN();
                    counter.reset();
                } finally {
                    lock.unlock();
                }
                called = 0;
View Full Code Here


        super.gaugeStopped(gauge);
    }

    @Override
    public void addToGauge(final Role role, final long time, final double value) {
        OptimizedStatistics stat = gauges.get(role);
        if (stat == null) {
            stat = new OptimizedStatistics();
            final OptimizedStatistics existing = gauges.putIfAbsent(role, stat);
            if (existing != null) {
                stat = existing;
            }
        }
        stat.addValue(value);
View Full Code Here

        }
    }

    private static class InitializedDefaultCounter extends DefaultCounter {
        public InitializedDefaultCounter(final Key key, final InitializedCounterDataStore store, final Counter aggregate) {
            super(key, store, new OptimizedStatistics(
                aggregate.getHits(), aggregate.getSum(), aggregate.getMin(),
                aggregate.getMax(), aggregate.getMean(), aggregate.getSecondMoment()
            ));
        }
View Full Code Here

TOP

Related Classes of org.apache.sirona.counters.OptimizedStatistics

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.