本文整理汇总了Java中org.springframework.boot.actuate.metrics.GaugeService.submit方法的典型用法代码示例。如果您正苦于以下问题:Java GaugeService.submit方法的具体用法?Java GaugeService.submit怎么用?Java GaugeService.submit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.boot.actuate.metrics.GaugeService
的用法示例。
在下文中一共展示了GaugeService.submit方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: provideAdditionalWriter
import org.springframework.boot.actuate.metrics.GaugeService; //导入方法依赖的package包/类
@Test
public void provideAdditionalWriter() {
this.context = new AnnotationConfigApplicationContext(WriterConfig.class,
MetricRepositoryAutoConfiguration.class,
MetricExportAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
GaugeService gaugeService = this.context.getBean(GaugeService.class);
assertNotNull(gaugeService);
gaugeService.submit("foo", 2.7);
MetricExporters exporters = this.context.getBean(MetricExporters.class);
MetricCopyExporter exporter = (MetricCopyExporter) exporters.getExporters()
.get("writer");
exporter.setIgnoreTimestamps(true);
exporter.export();
MetricWriter writer = this.context.getBean("writer", MetricWriter.class);
Mockito.verify(writer, Mockito.atLeastOnce()).set(Matchers.any(Metric.class));
}
示例2: dropwizardInstalledIfPresent
import org.springframework.boot.actuate.metrics.GaugeService; //导入方法依赖的package包/类
@Test
public void dropwizardInstalledIfPresent() {
this.context = new AnnotationConfigApplicationContext(
MetricsDropwizardAutoConfiguration.class,
MetricRepositoryAutoConfiguration.class, AopAutoConfiguration.class);
GaugeService gaugeService = this.context.getBean(GaugeService.class);
assertThat(gaugeService).isNotNull();
gaugeService.submit("foo", 2.7);
DropwizardMetricServices exporter = this.context
.getBean(DropwizardMetricServices.class);
assertThat(exporter).isEqualTo(gaugeService);
MetricRegistry registry = this.context.getBean(MetricRegistry.class);
@SuppressWarnings("unchecked")
Gauge<Double> gauge = (Gauge<Double>) registry.getMetrics().get("gauge.foo");
assertThat(gauge.getValue()).isEqualTo(new Double(2.7));
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:17,代码来源:MetricRepositoryAutoConfigurationTests.java
示例3: provideAdditionalWriter
import org.springframework.boot.actuate.metrics.GaugeService; //导入方法依赖的package包/类
@Test
public void provideAdditionalWriter() {
this.context = new AnnotationConfigApplicationContext(WriterConfig.class,
MetricRepositoryAutoConfiguration.class,
MetricExportAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
GaugeService gaugeService = this.context.getBean(GaugeService.class);
assertThat(gaugeService).isNotNull();
gaugeService.submit("foo", 2.7);
MetricExporters exporters = this.context.getBean(MetricExporters.class);
MetricCopyExporter exporter = (MetricCopyExporter) exporters.getExporters()
.get("writer");
exporter.setIgnoreTimestamps(true);
exporter.export();
MetricWriter writer = this.context.getBean("writer", MetricWriter.class);
Mockito.verify(writer, Mockito.atLeastOnce()).set(Matchers.any(Metric.class));
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:18,代码来源:MetricExportAutoConfigurationTests.java
示例4: dropwizardInstalledIfPresent
import org.springframework.boot.actuate.metrics.GaugeService; //导入方法依赖的package包/类
@Test
public void dropwizardInstalledIfPresent() {
this.context = new AnnotationConfigApplicationContext(
MetricsDropwizardAutoConfiguration.class,
MetricRepositoryAutoConfiguration.class, AopAutoConfiguration.class);
GaugeService gaugeService = this.context.getBean(GaugeService.class);
assertNotNull(gaugeService);
gaugeService.submit("foo", 2.7);
DropwizardMetricServices exporter = this.context
.getBean(DropwizardMetricServices.class);
assertEquals(gaugeService, exporter);
MetricRegistry registry = this.context.getBean(MetricRegistry.class);
@SuppressWarnings("unchecked")
Gauge<Double> gauge = (Gauge<Double>) registry.getMetrics().get("gauge.foo");
assertEquals(new Double(2.7), gauge.getValue());
}
示例5: createServices
import org.springframework.boot.actuate.metrics.GaugeService; //导入方法依赖的package包/类
@Test
public void createServices() throws Exception {
this.context = new AnnotationConfigApplicationContext(
MetricRepositoryAutoConfiguration.class);
GaugeService gaugeService = this.context.getBean(BufferGaugeService.class);
assertThat(gaugeService).isNotNull();
assertThat(this.context.getBean(BufferCounterService.class)).isNotNull();
assertThat(this.context.getBean(PrefixMetricReader.class)).isNotNull();
gaugeService.submit("foo", 2.7);
MetricReader bean = this.context.getBean(MetricReader.class);
assertThat(bean.findOne("gauge.foo").getValue()).isEqualTo(2.7);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:MetricRepositoryAutoConfigurationTests.java
示例6: metricsFlushAutomatically
import org.springframework.boot.actuate.metrics.GaugeService; //导入方法依赖的package包/类
@Test
public void metricsFlushAutomatically() throws Exception {
this.context = new AnnotationConfigApplicationContext(WriterConfig.class,
MetricRepositoryAutoConfiguration.class,
MetricExportAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
GaugeService gaugeService = this.context.getBean(GaugeService.class);
assertThat(gaugeService).isNotNull();
gaugeService.submit("foo", 2.7);
MetricExporters flusher = this.context.getBean(MetricExporters.class);
flusher.close(); // this will be called by Spring on shutdown
MetricWriter writer = this.context.getBean("writer", MetricWriter.class);
Mockito.verify(writer, Mockito.atLeastOnce()).set(Matchers.any(Metric.class));
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:MetricExportAutoConfigurationTests.java
示例7: createServices
import org.springframework.boot.actuate.metrics.GaugeService; //导入方法依赖的package包/类
@Test
public void createServices() throws Exception {
this.context = new AnnotationConfigApplicationContext(
MetricRepositoryAutoConfiguration.class);
GaugeService gaugeService = this.context.getBean(BufferGaugeService.class);
assertNotNull(gaugeService);
assertNotNull(this.context.getBean(BufferCounterService.class));
assertNotNull(this.context.getBean(PrefixMetricReader.class));
gaugeService.submit("foo", 2.7);
assertEquals(2.7,
this.context.getBean(MetricReader.class).findOne("gauge.foo").getValue());
}
示例8: ResourceRepository
import org.springframework.boot.actuate.metrics.GaugeService; //导入方法依赖的package包/类
@Autowired
public ResourceRepository(final GaugeService gaugeService) {
this.gaugeService = gaugeService;
gaugeService.submit("gauge.repository.resource.count", resourceCount());
}