Examples of timer()


Examples of com.codahale.metrics.MetricRegistry.timer()

        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

Examples of com.codahale.metrics.MetricRegistry.timer()

        }
        this.otherMeter = metricsRegistry.meter(name(metricName,
                                                     otherMetricName));
        this.activeRequests = metricsRegistry.counter(name(metricName,
                                                           "activeRequests"));
        this.requestTimer = metricsRegistry.timer(name(metricName,
                                                       "requests"));

    }

    private MetricRegistry getMetricsFactory(FilterConfig filterConfig) {
View Full Code Here

Examples of com.codahale.metrics.MetricRegistry.timer()

        post(new Route("/checkout") {
            @Override
            public Object handle(Request request, Response response) {
                // emulate calling external payment API
                Timer.Context timer = metrics.timer("payment.runtime").time();

                try {
                    Thread.sleep(new Random().nextInt(1000));
                } catch (InterruptedException e) {
                    // ignore
View Full Code Here

Examples of com.codahale.metrics.MetricRegistry.timer()

            final Values values = this.execContext.getValues();

            final Processor<In, Out> process = this.node.processor;
            final MetricRegistry registry = this.node.metricRegistry;
            final String name = ProcessorGraphNode.class.getName() + "_compute():" + process.getClass();
            Timer.Context timerContext = registry.timer(name).time();
            try {
                In inputParameter = ProcessorUtils.populateInputParameter(process, values);

                Out output;
                try {
View Full Code Here

Examples of com.codahale.metrics.MetricRegistry.timer()

        // Again reflection, but there are no other way
        ConnectionFactory connectionFactory = connector.getConnectionFactory("http/1.1");
        assertThat(connectionFactory).isInstanceOf(InstrumentedConnectionFactory.class);
        assertThat(getField(InstrumentedConnectionFactory.class, "timer", true).get(connectionFactory))
                .isSameAs(metrics.timer("org.eclipse.jetty.server.HttpConnectionFactory.127.0.0.1.8080.connections"));
        HttpConnectionFactory httpConnectionFactory = (HttpConnectionFactory)
                getField(InstrumentedConnectionFactory.class, "connectionFactory", true).get(connectionFactory);
        assertThat(httpConnectionFactory.getInputBufferSize()).isEqualTo(8192);

        HttpConfiguration httpConfiguration = httpConnectionFactory.getHttpConfiguration();
View Full Code Here

Examples of com.codahale.metrics.MetricRegistry.timer()

    context.addInterceptor(blockingExecTimingInterceptor, new Action<Execution>() {
      @Override
      public void execute(Execution execution) throws Exception {
        String tag = buildRequestTimerTag(request.getUri(), request.getMethod().getName());
        final Timer.Context timer = metricRegistry.timer(tag).time();
        context.onClose(new Action<RequestOutcome>() {
          public void execute(RequestOutcome thing) throws Exception {
            timer.stop();
          }
        });
View Full Code Here

Examples of com.codahale.metrics.MetricRegistry.timer()

    public ScriptServer(final RexsterApplication rexsterApplication) {
        this.rexsterApplication = rexsterApplication;

        final MetricRegistry metricRegistry = this.rexsterApplication.getMetricRegistry();
        this.scriptTimer = metricRegistry.timer(MetricRegistry.name("rexpro", "script-engine"));
        this.successfulExecutions = metricRegistry.counter(MetricRegistry.name("rexpro", "script-engine", "success"));
        this.failedExecutions = metricRegistry.counter(MetricRegistry.name("rexpro", "script-engine", "fail"));
    }
    public void handleRequest(ScriptRequestMessage message, RexProRequest request) throws IOException {
View Full Code Here

Examples of com.codahale.metrics.MetricRegistry.timer()

    private ExtensionResponse tryExecuteGremlinScript(final RexsterResourceContext rexsterResourceContext,
                                                      final Graph graph, final Vertex vertex, final Edge edge,
                                                      final String script) {

        final MetricRegistry metricRegistry = rexsterResourceContext.getMetricRegistry();
        final Timer scriptTimer = metricRegistry.timer(MetricRegistry.name("http", "script-engine"));
        final Counter successfulExecutions = metricRegistry.counter(MetricRegistry.name("http", "script-engine", "success"));
        final Counter failedExecutions = metricRegistry.counter(MetricRegistry.name("http", "script-engine", "fail"));

        ExtensionResponse extensionResponse;
View Full Code Here

Examples of com.codahale.metrics.MetricRegistry.timer()

        }
        this.otherMeter = metricsRegistry.meter(name(WebappMetricsFilter.class,
                                                     otherMetricName));
        this.activeRequests = metricsRegistry.counter(name(WebappMetricsFilter.class,
                                                           "activeRequests"));
        this.requestTimer = metricsRegistry.timer(name(WebappMetricsFilter.class,
                                                       "requests"));

    }

    private MetricRegistry getMetricsFactory(FilterConfig filterConfig) {
View Full Code Here

Examples of com.codahale.metrics.MetricRegistry.timer()

        }
        this.otherMeter = metricsRegistry.meter(name(AbstractInstrumentedFilter.class,
                                                     otherMetricName));
        this.activeRequests = metricsRegistry.counter(name(AbstractInstrumentedFilter.class,
                                                           "activeRequests"));
        this.requestTimer = metricsRegistry.timer(name(AbstractInstrumentedFilter.class,
                                                       "requests"));

    }

    private MetricRegistry getMetricsFactory(FilterConfig filterConfig) {
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.