Package org.springframework.boot.actuate.metrics.writer

Examples of org.springframework.boot.actuate.metrics.writer.DefaultGaugeService.submit()


        SyncTaskExecutorConfiguration.class,
        MetricRepositoryAutoConfiguration.class);
    DefaultGaugeService gaugeService = context.getBean(DefaultGaugeService.class);
    assertNotNull(gaugeService);
    assertNotNull(context.getBean(DefaultCounterService.class));
    gaugeService.submit("foo", 2.7);
    assertEquals(2.7, context.getBean(MetricReader.class).findOne("gauge.foo")
        .getValue());
    context.close();
  }
View Full Code Here


    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
        SyncTaskExecutorConfiguration.class, WriterConfig.class,
        MetricRepositoryAutoConfiguration.class);
    DefaultGaugeService gaugeService = context.getBean(DefaultGaugeService.class);
    assertNotNull(gaugeService);
    gaugeService.submit("foo", 2.7);
    MetricWriter writer = context.getBean("writer", MetricWriter.class);
    verify(writer).set(any(Metric.class));
    context.close();
  }
View Full Code Here

    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
        SyncTaskExecutorConfiguration.class, WriterConfig.class,
        MetricRepositoryAutoConfiguration.class);
    DefaultGaugeService gaugeService = context.getBean(DefaultGaugeService.class);
    assertNotNull(gaugeService);
    gaugeService.submit("foo", 2.7);
    MetricRegistry registry = context.getBean(MetricRegistry.class);
    @SuppressWarnings("unchecked")
    Gauge<Double> gauge = (Gauge<Double>) registry.getMetrics().get("gauge.foo");
    assertEquals(new Double(2.7), gauge.getValue());
    context.close();
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.