Java 类org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint 实例源码

项目:spring-cloud-dashboard    文件:RestControllerAdvice.java   
/**
 * Log the exception message at warn level and stack trace as trace level.
 * Return response status HttpStatus.NOT_FOUND
 */
@ExceptionHandler({NoSuchAppRegistrationException.class,
        NoSuchTaskDefinitionException.class,
        NoSuchTaskExecutionException.class,
        NoSuchJobExecutionException.class,
        NoSuchJobInstanceException.class,
        NoSuchJobException.class,
        NoSuchStepExecutionException.class,
        MetricsMvcEndpoint.NoSuchMetricException.class})
@ResponseStatus(HttpStatus.NOT_FOUND)
@ResponseBody
public VndErrors onNotFoundException(Exception e) {
    String logref = logWarnLevelExceptionMessage(e);
    if (logger.isTraceEnabled()) {
        logTraceLevelStrackTrace(e);
    }
    String msg = getExceptionMessage(e);
    return new VndErrors(logref, msg);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MvcEndpointPathConfigurationTests.java   
@Parameters(name = "{0}")
public static Object[] parameters() {
    return new Object[] { new Object[] { "actuator", HalJsonMvcEndpoint.class },
            new Object[] { "autoconfig", AutoConfigurationReportEndpoint.class },
            new Object[] { "beans", BeansEndpoint.class },
            new Object[] { "configprops",
                    ConfigurationPropertiesReportEndpoint.class },
            new Object[] { "docs", DocsMvcEndpoint.class },
            new Object[] { "dump", DumpEndpoint.class },
            new Object[] { "env", EnvironmentMvcEndpoint.class },
            new Object[] { "flyway", FlywayEndpoint.class },
            new Object[] { "health", HealthMvcEndpoint.class },
            new Object[] { "info", InfoEndpoint.class },
            new Object[] { "jolokia", JolokiaMvcEndpoint.class },
            new Object[] { "liquibase", LiquibaseEndpoint.class },
            new Object[] { "logfile", LogFileMvcEndpoint.class },
            new Object[] { "mappings", RequestMappingEndpoint.class },
            new Object[] { "metrics", MetricsMvcEndpoint.class },
            new Object[] { "shutdown", ShutdownEndpoint.class },
            new Object[] { "trace", TraceEndpoint.class } };
}
项目:spring-boot-concourse    文件:MvcEndpointPathConfigurationTests.java   
@Parameters(name = "{0}")
public static Object[] parameters() {
    return new Object[] { new Object[] { "actuator", HalJsonMvcEndpoint.class },
            new Object[] { "autoconfig", AutoConfigurationReportEndpoint.class },
            new Object[] { "beans", BeansEndpoint.class },
            new Object[] { "configprops",
                    ConfigurationPropertiesReportEndpoint.class },
            new Object[] { "docs", DocsMvcEndpoint.class },
            new Object[] { "dump", DumpEndpoint.class },
            new Object[] { "env", EnvironmentMvcEndpoint.class },
            new Object[] { "flyway", FlywayEndpoint.class },
            new Object[] { "health", HealthMvcEndpoint.class },
            new Object[] { "info", InfoEndpoint.class },
            new Object[] { "jolokia", JolokiaMvcEndpoint.class },
            new Object[] { "liquibase", LiquibaseEndpoint.class },
            new Object[] { "logfile", LogFileMvcEndpoint.class },
            new Object[] { "mappings", RequestMappingEndpoint.class },
            new Object[] { "metrics", MetricsMvcEndpoint.class },
            new Object[] { "shutdown", ShutdownEndpoint.class },
            new Object[] { "trace", TraceEndpoint.class } };
}
项目:spring-cloud-dataflow    文件:RestControllerAdvice.java   
/**
 * Log the exception message at warn level and stack trace as trace level. Return
 * response status HttpStatus.NOT_FOUND
 *
 * @param e one of the exceptions, {@link NoSuchStreamDefinitionException},
 * {@link NoSuchAppRegistrationException}, {@link NoSuchTaskDefinitionException},
 * {@link NoSuchTaskExecutionException}, {@link NoSuchJobExecutionException},
 * {@link NoSuchJobInstanceException}, {@link NoSuchJobException},
 * {@link NoSuchStepExecutionException},
 * {@link MetricsMvcEndpoint.NoSuchMetricException}, {@link NoSuchAppException}, or
 * {@link NoSuchAppInstanceException}
 * @return the error response in JSON format with media type
 * application/vnd.error+json
 */
@ExceptionHandler({ NoSuchStreamDefinitionException.class, NoSuchAppRegistrationException.class,
        NoSuchTaskDefinitionException.class, NoSuchTaskExecutionException.class, NoSuchJobExecutionException.class,
        NoSuchJobInstanceException.class, NoSuchJobException.class, NoSuchStepExecutionException.class,
        MetricsMvcEndpoint.NoSuchMetricException.class, NoSuchAppException.class,
        NoSuchAppInstanceException.class, ApplicationDoesNotExistException.class })
@ResponseStatus(HttpStatus.NOT_FOUND)
@ResponseBody
public VndErrors onNotFoundException(Exception e) {
    String logref = logWarnLevelExceptionMessage(e);
    if (logger.isTraceEnabled()) {
        logTraceLevelStrackTrace(e);
    }
    String msg = getExceptionMessage(e);
    return new VndErrors(logref, msg);
}
项目:spring-analytics    文件:FieldValueCounterController.java   
/**
 * Retrieve information about a specific counter.
 */
@RequestMapping(value = "/{name}", method = RequestMethod.GET)
public FieldValueCounterResource display(@PathVariable("name") String name) {
    FieldValueCounter counter = repository.findOne(name);
    if (counter == null) {
        throw new MetricsMvcEndpoint.NoSuchMetricException(name);
    }
    return deepAssembler.toResource(counter);
}
项目:spring-analytics    文件:FieldValueCounterController.java   
/**
 * Delete (reset) a specific counter.
 */
@RequestMapping(value = "/{name}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.OK)
protected void delete(@PathVariable("name") String name) {
    FieldValueCounter counter = repository.findOne(name);
    if (counter == null) {
        throw new MetricsMvcEndpoint.NoSuchMetricException(name);
    }
    repository.reset(name);
}
项目:spring-analytics    文件:CounterController.java   
/**
 * Find a given counter, taking care of name conversion between the Spring Boot domain and our domain.
 * @throws MetricsMvcEndpoint.NoSuchMetricException if the counter does not exist
 */
private Metric<Double> findCounter(@PathVariable("name") String name) {
    @SuppressWarnings("unchecked")
    Metric<Double> c = (Metric<Double>) metricRepository.findOne(COUNTER_PREFIX + name);
    if (c == null) {
        throw new MetricsMvcEndpoint.NoSuchMetricException(name);
    }
    return c;
}
项目:spring-analytics    文件:AggregateCounterController.java   
/**
 * Retrieve information about a specific aggregate counter.
 */
@RequestMapping(value = "/{name}", method = RequestMethod.GET)
public AggregateCounterResource display(@PathVariable("name") String name) {
    AggregateCounter counter = repository.findOne(name);
    if (counter == null) {
        throw new MetricsMvcEndpoint.NoSuchMetricException(name);
    }
    return deepAssembler.toResource(counter);
}
项目:spring-analytics    文件:AggregateCounterController.java   
/**
 * Delete (reset) a specific counter.
 */
@RequestMapping(value = "/{name}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.OK)
protected void delete(@PathVariable("name") String name) {
    AggregateCounter counter = repository.findOne(name);
    if (counter == null) {
        throw new MetricsMvcEndpoint.NoSuchMetricException(name);
    }
    repository.reset(name);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointWebMvcManagementContextConfiguration.java   
@Bean
@ConditionalOnBean(MetricsEndpoint.class)
@ConditionalOnEnabledEndpoint("metrics")
public MetricsMvcEndpoint metricsMvcEndpoint(MetricsEndpoint delegate) {
    return new MetricsMvcEndpoint(delegate);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void metricsEndpointDisabled() throws Exception {
    endpointDisabled("metrics", MetricsMvcEndpoint.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void metricsEndpointEnabledOverride() throws Exception {
    endpointEnabledOverride("metrics", MetricsMvcEndpoint.class);
}
项目:spring-boot-concourse    文件:EndpointWebMvcManagementContextConfiguration.java   
@Bean
@ConditionalOnBean(MetricsEndpoint.class)
@ConditionalOnEnabledEndpoint("metrics")
public MetricsMvcEndpoint metricsMvcEndpoint(MetricsEndpoint delegate) {
    return new MetricsMvcEndpoint(delegate);
}
项目:spring-boot-concourse    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void metricsEndpointDisabled() throws Exception {
    endpointDisabled("metrics", MetricsMvcEndpoint.class);
}
项目:spring-boot-concourse    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void metricsEndpointEnabledOverride() throws Exception {
    endpointEnabledOverride("metrics", MetricsMvcEndpoint.class);
}
项目:contestparser    文件:EndpointWebMvcManagementContextConfiguration.java   
@Bean
@ConditionalOnBean(MetricsEndpoint.class)
@ConditionalOnEnabledEndpoint("metrics")
public MetricsMvcEndpoint metricsMvcEndpoint(MetricsEndpoint delegate) {
    return new MetricsMvcEndpoint(delegate);
}
项目:contestparser    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void metricsEndpointDisabled() throws Exception {
    endpointDisabled("metrics", MetricsMvcEndpoint.class);
}
项目:contestparser    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void metricsEndpointEnabledOverride() throws Exception {
    endpointEnabledOverride("metrics", MetricsMvcEndpoint.class);
}