Examples of CassandraGaugeDataStore


Examples of org.apache.sirona.cassandra.agent.gauge.CassandraGaugeDataStore

@RunWith(CassandraRunner.class)
public class GaugeDataStoreTest {
    @Test
    public void gauges() throws InterruptedException, IllegalAccessException {
        final CassandraGaugeDataStore store = IoCs.processInstance(new CassandraGaugeDataStore() {
            @Created
            protected void forceMarker() {
                marker = "test";
            }

            @Override
            protected int getPeriod(final String prefix) {
                return 100;
            }
        });

        assertEquals(0, store.gauges().size());

        final Gauge gauge = new Gauge() {
            @Override
            public Role role() {
                return Role.FAILURES;
            }

            @Override
            public double value() {
                return 5;
            }
        };
        store.createOrNoopGauge(gauge.role());
        store.addGauge(gauge);

        Thread.sleep(250);
        store.shutdown();

        final Collection<Role> gauges = store.gauges();
        assertEquals(1, gauges.size());

        assertEquals(gauge.role(), gauges.iterator().next());
        final SortedMap<Long,Double> gaugeValues = store.getGaugeValues(new GaugeValuesRequest(0, System.currentTimeMillis(), Role.FAILURES));
        assertTrue(gaugeValues.size() > 0);
        assertEquals(5., gaugeValues.values().iterator().next(), 0.);

        store.gaugeStopped(gauge.role());
    }
View Full Code Here

Examples of org.apache.sirona.cassandra.agent.gauge.CassandraGaugeDataStore

public class CassandraAgentDataStoreFactory extends DelegateDataStoreFactory {
    public CassandraAgentDataStoreFactory() {
        super(
            IoCs.processInstance(new CassandraCounterDataStore()),
            IoCs.processInstance(new CassandraGaugeDataStore()),
            IoCs.processInstance(new CassandraStatusDataStore()),
            IoCs.processInstance(new CassandraPathTrackingDataStore()));
    }
View Full Code Here

Examples of org.apache.sirona.cassandra.agent.gauge.CassandraGaugeDataStore

public class CassandraAgentDataStoreFactory extends DelegateDataStoreFactory {
    public CassandraAgentDataStoreFactory() {
        super(
            IoCs.processInstance(new CassandraCounterDataStore()),
            IoCs.processInstance(new CassandraGaugeDataStore()),
            IoCs.processInstance(new CassandraStatusDataStore()));
    }
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.