Polish
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -76,8 +76,7 @@ public class EndpointMBean implements DynamicMBean {
|
||||
@Override
|
||||
public Object invoke(String actionName, Object[] params, String[] signature)
|
||||
throws MBeanException, ReflectionException {
|
||||
JmxOperation operation = this.endpointInfo.getOperations()
|
||||
.get(actionName);
|
||||
JmxOperation operation = this.endpointInfo.getOperations().get(actionName);
|
||||
if (operation != null) {
|
||||
Map<String, Object> arguments = getArguments(params,
|
||||
operation.getParameters());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -53,8 +53,7 @@ class EndpointMBeanInfoAssembler {
|
||||
* @param endpointInfo the endpoint to handle
|
||||
* @return the mbean info for the endpoint
|
||||
*/
|
||||
EndpointMBeanInfo createEndpointMBeanInfo(
|
||||
EndpointInfo<JmxOperation> endpointInfo) {
|
||||
EndpointMBeanInfo createEndpointMBeanInfo(EndpointInfo<JmxOperation> endpointInfo) {
|
||||
Map<String, OperationInfos> operationsMapping = getOperationInfo(endpointInfo);
|
||||
ModelMBeanOperationInfo[] operationsMBeanInfo = operationsMapping.values()
|
||||
.stream().map((t) -> t.mBeanOperationInfo).collect(Collectors.toList())
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,8 +38,7 @@ public class EndpointLinksResolver {
|
||||
* @return the links
|
||||
*/
|
||||
public Map<String, Link> resolveLinks(
|
||||
Collection<EndpointInfo<WebOperation>> webEndpoints,
|
||||
String requestUrl) {
|
||||
Collection<EndpointInfo<WebOperation>> webEndpoints, String requestUrl) {
|
||||
String normalizedUrl = normalizeRequestUrl(requestUrl);
|
||||
Map<String, Link> links = new LinkedHashMap<>();
|
||||
links.put("self", new Link(normalizedUrl));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -117,8 +117,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping
|
||||
registerMapping(mapping, this, getLinks());
|
||||
}
|
||||
|
||||
protected RequestMappingInfo createRequestMappingInfo(
|
||||
WebOperation operationInfo) {
|
||||
protected RequestMappingInfo createRequestMappingInfo(WebOperation operationInfo) {
|
||||
OperationRequestPredicate requestPredicate = operationInfo.getRequestPredicate();
|
||||
PatternsRequestCondition patterns = new PatternsRequestCondition(pathPatternParser
|
||||
.parse(this.endpointMapping.createSubPath(requestPredicate.getPath())));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -132,8 +132,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping
|
||||
|
||||
protected abstract void registerMappingForOperation(WebOperation operation);
|
||||
|
||||
protected RequestMappingInfo createRequestMappingInfo(
|
||||
WebOperation operationInfo) {
|
||||
protected RequestMappingInfo createRequestMappingInfo(WebOperation operationInfo) {
|
||||
OperationRequestPredicate requestPredicate = operationInfo.getRequestPredicate();
|
||||
PatternsRequestCondition patterns = patternsRequestConditionForPattern(
|
||||
requestPredicate.getPath());
|
||||
|
||||
@@ -91,8 +91,7 @@ public class MetricsEndpoint {
|
||||
Map<Statistic, Double> samples = getSamples(meters);
|
||||
Map<String, Set<String>> availableTags = getAvailableTags(meters);
|
||||
tags.forEach((t) -> availableTags.remove(t.getKey()));
|
||||
return new MetricResponse(requiredMetricName,
|
||||
asList(samples, Sample::new),
|
||||
return new MetricResponse(requiredMetricName, asList(samples, Sample::new),
|
||||
asList(availableTags, AvailableTag::new));
|
||||
}
|
||||
|
||||
|
||||
@@ -247,14 +247,15 @@ public class WebMvcMetricsFilterTests {
|
||||
|
||||
@Bean
|
||||
PrometheusMeterRegistry prometheus() {
|
||||
PrometheusMeterRegistry r = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT, new CollectorRegistry(), Clock.SYSTEM);
|
||||
PrometheusMeterRegistry r = new PrometheusMeterRegistry(
|
||||
PrometheusConfig.DEFAULT, new CollectorRegistry(), Clock.SYSTEM);
|
||||
r.config().meterFilter(new MeterFilter() {
|
||||
@Override
|
||||
public MeterFilterReply accept(Meter.Id id) {
|
||||
for (Tag tag : id.getTags()) {
|
||||
if (tag.getKey().equals("uri")
|
||||
&& (tag.getValue().contains("histogram")
|
||||
|| tag.getValue().contains("percentiles"))) {
|
||||
|| tag.getValue().contains("percentiles"))) {
|
||||
return MeterFilterReply.ACCEPT;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user