Package org.apache.sirona.cassandra.agent.status

Examples of org.apache.sirona.cassandra.agent.status.CassandraStatusDataStore


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

            @Override
            protected NodeStatusReporter newNodeStatusReporter() {
                return new NodeStatusReporter() {
                    @Override
                    public synchronized NodeStatus computeStatus() {
                        return new NodeStatus(new ValidationResult[]{new ValidationResult("sample", Status.OK, "msg")}, new Date());
                    }
                };
            }

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

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

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

        final Map<String,NodeStatus> statuses = store.statuses();
        assertEquals(1, statuses.size());
        assertTrue(statuses.containsKey("test"));

        final ValidationResult[] results = statuses.get("test").getResults();
        assertEquals(1, results.length);
View Full Code Here


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

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

Related Classes of org.apache.sirona.cassandra.agent.status.CassandraStatusDataStore

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.