Examples of LeafCollectorCounter


Examples of org.apache.sirona.store.counter.LeafCollectorCounter

        final Iterator<LeafCollectorCounter> iterator = statistics.iterator();
        if (!iterator.hasNext()) {
            return null;
        }

        LeafCollectorCounter current = iterator.next();
        long n = current.getHits();
        double min = current.getMin();
        double sum = current.getSum();
        double max = current.getMax();
        double m2 = current.getSecondMoment();
        double mean = current.getMean();
        while (iterator.hasNext()) {
            current = iterator.next();
            if (current.getMin() < min || Double.isNaN(min)) {
                min = current.getMin();
            }
            if (current.getMax() > max || Double.isNaN(max)) {
                max = current.getMax();
            }
            sum += current.getSum();
            final double oldN = n;
            final double curN = current.getHits();
            n += curN;
            final double meanDiff = current.getMean() - mean;
            mean = sum / n;
            m2 = m2 + current.getSecondMoment() + meanDiff * meanDiff * oldN * curN / n;
        }

        final double variance;
        if (n == 0) {
            variance = Double.NaN;
View Full Code Here

Examples of org.apache.sirona.store.counter.LeafCollectorCounter

    @Override // TODO: see if we shouldn't store it or if aggregation can be done on java side
    public AggregatedCollectorCounter getOrCreateCounter(final Counter.Key key) {
        final Map<String, LeafCollectorCounter> counters = new HashMap<String, LeafCollectorCounter>();
        for (final String marker : markers()) {
            final LeafCollectorCounter c = getOrCreateCounter(key, marker);
            counters.put(marker, c);
        }
        return new AggregatedCollectorCounter(key, counters);
    }
View Full Code Here

Examples of org.apache.sirona.store.counter.LeafCollectorCounter

        assertNull(new CassandraCollectorCounterDataStore().findByKey(key, marker));
        new CassandraCollectorCounterDataStore().getOrCreateCounter(key, marker);
        assertNotNull(new CassandraCollectorCounterDataStore().findByKey(key, marker));

        final LeafCollectorCounter counter = new CassandraCollectorCounterDataStore().getOrCreateCounter(key, marker);
        assertEquals("K100Drap#1", counter.getKey().getName());
        assertEquals("K100Drap", counter.getKey().getRole().getName());
    }
View Full Code Here

Examples of org.apache.sirona.store.counter.LeafCollectorCounter

        new CassandraCollectorCounterDataStore().getOrCreateCounter(key, "node1");
        assertNotNull(new CassandraCollectorCounterDataStore().findByKey(key, "node1"));
        new CassandraCollectorCounterDataStore().update(key, "node1", new M2AwareStatisticalSummary(3, 4, 4, 4, 4, 4, 4), 2);

        final LeafCollectorCounter counter = new CassandraCollectorCounterDataStore().getOrCreateCounter(key, "node1");
        assertEquals("K100Drap#1", counter.getKey().getName());
        assertEquals("K100Drap", counter.getKey().getRole().getName());
        assertEquals(4, counter.getMax(), 0.);
        assertEquals(2, counter.getMaxConcurrency(), 0.);
    }
View Full Code Here

Examples of org.apache.sirona.store.counter.LeafCollectorCounter

    @Override // TODO: see if we shouldn't store it or if aggregation can be done on java side
    public AggregatedCollectorCounter getOrCreateCounter(final Counter.Key key) {
        final Map<String, LeafCollectorCounter> counters = new HashMap<String, LeafCollectorCounter>();
        for (final String marker : markers()) {
            final LeafCollectorCounter c = getOrCreateCounter(key, marker);
            counters.put(marker, c);
        }
        return new AggregatedCollectorCounter(key, counters);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.