Package com.codahale.metrics

Examples of com.codahale.metrics.MetricRegistry


    int batchSize = SEQ_NUM2.incrementAndGet() % 2 == 0 ? 100 : 1;
    DocumentLoader testServer = new SolrServerDocumentLoader(solrServer, batchSize);
    MorphlineContext solrMorphlineContext = new SolrMorphlineContext.Builder()
      .setDocumentLoader(testServer)
      .setExceptionHandler(new FaultTolerance(false, false, SolrServerException.class.getName()))
      .setMetricRegistry(new MetricRegistry()).build();
   
    MorphlineHandlerImpl impl = new MorphlineHandlerImpl();
    impl.setMorphlineContext(solrMorphlineContext);
   
    class MySolrLocator extends SolrLocator { // trick to access protected ctor
View Full Code Here


        bindingsModules.addAll(pluginModules);
        final Injector injector = GuiceInjectorHolder.createInjector(bindingsModules);
        instantiationService.setInjector(injector);

        // This is holding all our metrics.
        final MetricRegistry metrics = injector.getInstance(MetricRegistry.class);

        // Report metrics via JMX.
        final JmxReporter reporter = JmxReporter.forRegistry(metrics).build();
        reporter.start();
View Full Code Here

@Singleton
public class MetricRegistryProvider implements Provider<MetricRegistry> {
    private final MetricRegistry metricRegistry;

    public MetricRegistryProvider() {
        this.metricRegistry = new MetricRegistry();

        metricRegistry.register("jvm.buffers", new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()));
        metricRegistry.register("jvm.cl", new ClassLoadingGaugeSet());
        metricRegistry.register("jvm.gc", new GarbageCollectorMetricSet());
        metricRegistry.register("jvm.memory", new MemoryUsageGaugeSet());
View Full Code Here

        assertEquals(filterRegistry.get(2), third);
    }

    @Test
    public void testHandleMessageEmptyFilterSet() throws Exception {
        MetricRegistry metricRegistry = mock(MetricRegistry.class);
        AtomicInteger processBufferWatermark = new AtomicInteger();
        OutputBuffer outputBuffer = mock(OutputBuffer.class);
        final Configuration configuration = mock(Configuration.class);
        when(configuration.isDisableOutputCache()).thenReturn(false);
View Full Code Here

        } catch (RuntimeException ignored) {}
    }

    @Test
    public void testHandleMessage() {
        MetricRegistry metricRegistry = new MetricRegistry();
        AtomicInteger processBufferWatermark = new AtomicInteger();
        OutputBuffer outputBuffer = mock(OutputBuffer.class);
        final Configuration configuration = mock(Configuration.class);
        when(configuration.isDisableOutputCache()).thenReturn(false);
View Full Code Here

        assertEquals(jobID2, manager.getRunningJobs().get(jobID2).getId());
    }

    @Test
    public void testConcurrentJobs() throws Exception {
        SystemJobManager manager = new SystemJobManager(mock(ActivityWriter.class), new MetricRegistry());

        SystemJob job1 = new LongRunningJob(3);
        SystemJob job2 = new LongRunningJob(3);
        SystemJob job3 = new AnotherLongRunningJob(3);
View Full Code Here

        assertEquals(2, manager.concurrentJobs(job1.getClass()));
    }

    @Test
    public void testSubmitThrowsExceptionIfMaxConcurrencyLevelReached() throws Exception {
        SystemJobManager manager = new SystemJobManager(mock(ActivityWriter.class), new MetricRegistry());

        LongRunningJob job1 = new LongRunningJob(3);
        LongRunningJob job2 = new LongRunningJob(3);
        SystemJob job3 = new AnotherLongRunningJob(3);
View Full Code Here

    private Cluster cluster;
    private Messages messages;

    @BeforeMethod
    public void setUp() {
        metricRegistry = new MetricRegistry();
        cluster = mock(Cluster.class);
        messages = mock(Messages.class);
    }
View Full Code Here

        };
        when(cluster.isConnectedAndHealthy()).thenReturn(true);

        Messages messages = mock(Messages.class);
        final List<Message> messageList = buildMessages(3);
        MetricRegistry metricRegistry = new MetricRegistry();

        final BatchedElasticSearchOutput output = new BatchedElasticSearchOutput(metricRegistry, messages,
                                                                                 cluster, config);

        try {
View Full Code Here

public class ProcessBufferTest {
    private MetricRegistry metricRegistry;
    private ServerStatus serverStatus;

    private MetricRegistry getMockMetricRegistry() {
        final MetricRegistry mockMetricRegistry = mock(MetricRegistry.class);
        final Meter mockMeter = mock(Meter.class);
        final Timer mockTimer = mock(Timer.class);
        final Counter mockCounter = mock(Counter.class);
        when(mockMetricRegistry.meter(anyString())).thenReturn(mockMeter);
        when(mockMetricRegistry.timer(anyString())).thenReturn(mockTimer);
        when(mockMetricRegistry.counter(anyString())).thenReturn(mockCounter);

        return mockMetricRegistry;
    }
View Full Code Here

TOP

Related Classes of com.codahale.metrics.MetricRegistry

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.