Package org.apache.sirona.store.counter

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


public class CollectorDataStoreFactory
    extends DelegateDataStoreFactory
{
    public CollectorDataStoreFactory()
    {
        super( new InMemoryCollectorCounterStore(), //
               new DelegatedCollectorGaugeDataStore(), //
               new InMemoryCollectorNodeStatusDataStore(), //
               new DelegatedCollectorPathTrackingDataStore() );
    }
View Full Code Here


    @Test
    public void counterStore() {
        final Counter.Key key = new Counter.Key(new Role("r", Unit.UNARY), "n");

        // note: the input data are maybe not that consistent (min > max) but this test just checks computations
        final CollectorCounterStore store = new InMemoryCollectorCounterStore();
        store.update(key, "client1", new M2AwareStatisticalSummary(1, 2, 5, 0, 10, 6, 7), 4);
        store.update(key, "client2", new M2AwareStatisticalSummary(2, 4, 8, 1, 15, 9, 5), 2);

        assertEquals(2, store.markers().size());
        assertTrue(store.markers().contains("client1"));
        assertTrue(store.markers().contains("client2"));

        final Counter counter1 = store.getCounters("client1").iterator().next();
        assertEquals(4, counter1.getMaxConcurrency());
        assertEquals(4, counter1.currentConcurrency().get());
        assertEquals(5, counter1.getHits());
        assertEquals(10., counter1.getMin(), 0);
        assertEquals(0., counter1.getMax(), 0);
        assertEquals(1.4142, counter1.getStandardDeviation(), 0.001);
        assertEquals(2., counter1.getVariance(), 0);
        assertEquals(6., counter1.getSum(), 0);

        final Counter counter2 = store.getCounters("client2").iterator().next();
        assertEquals(2, counter2.getMaxConcurrency());
        assertEquals(2, counter2.currentConcurrency().get());
        assertEquals(8, counter2.getHits());
        assertEquals(15., counter2.getMin(), 0);
        assertEquals(1., counter2.getMax(), 0);
        assertEquals(2., counter2.getStandardDeviation(), 0.);
        assertEquals(4., counter2.getVariance(), 0);
        assertEquals(9., counter2.getSum(), 0);

        final Counter aggregate = store.getOrCreateCounter(key);
        assertEquals(6, aggregate.getMaxConcurrency());
        assertEquals(6, aggregate.currentConcurrency().get());
        assertEquals(13, aggregate.getHits());
        assertEquals(10., aggregate.getMin(), 0);
        assertEquals(1., aggregate.getMax(), 0);
View Full Code Here

import org.apache.sirona.store.status.InMemoryCollectorNodeStatusDataStore;
import org.apache.sirona.store.DelegateDataStoreFactory;

public class CollectorDataStoreFactory extends DelegateDataStoreFactory {
    public CollectorDataStoreFactory() {
        super(new InMemoryCollectorCounterStore(), new DelegatedCollectorGaugeDataStore(), new InMemoryCollectorNodeStatusDataStore());
    }
View Full Code Here

TOP

Related Classes of org.apache.sirona.store.counter.InMemoryCollectorCounterStore

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.