Merge branch '1.1.x'
Conflicts: spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java
This commit is contained in:
commit
53637eaa7c
|
|
@ -90,25 +90,25 @@ public class CodahaleMetricWriter implements MetricWriter {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
final double gauge = value.getValue().doubleValue();
|
final double gauge = value.getValue().doubleValue();
|
||||||
Object lock = null;
|
|
||||||
if (this.gaugeLocks.containsKey(name)) {
|
|
||||||
lock = this.gaugeLocks.get(name);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.gaugeLocks.putIfAbsent(name, new Object());
|
|
||||||
lock = this.gaugeLocks.get(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure we synchronize to avoid another thread pre-empting this thread after
|
// Ensure we synchronize to avoid another thread pre-empting this thread after
|
||||||
// remove causing an error in CodaHale metrics
|
// remove causing an error in CodaHale metrics
|
||||||
// NOTE: CodaHale provides no way to do this atomically
|
// NOTE: CodaHale provides no way to do this atomically
|
||||||
synchronized (lock) {
|
synchronized (getGuageLock(name)) {
|
||||||
this.registry.remove(name);
|
this.registry.remove(name);
|
||||||
this.registry.register(name, new SimpleGauge(gauge));
|
this.registry.register(name, new SimpleGauge(gauge));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Object getGuageLock(String name) {
|
||||||
|
Object lock = this.gaugeLocks.get(name);
|
||||||
|
if (lock == null) {
|
||||||
|
this.gaugeLocks.putIfAbsent(name, new Object());
|
||||||
|
lock = this.gaugeLocks.get(name);
|
||||||
|
}
|
||||||
|
return lock;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset(String metricName) {
|
public void reset(String metricName) {
|
||||||
this.registry.remove(metricName);
|
this.registry.remove(metricName);
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ import org.springframework.web.filter.OncePerRequestFilter;
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@Order(Ordered.HIGHEST_PRECEDENCE)
|
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||||
class ErrorPageFilter extends AbstractConfigurableEmbeddedServletContainer implements
|
public class ErrorPageFilter extends AbstractConfigurableEmbeddedServletContainer
|
||||||
Filter, NonEmbeddedServletContainerFactory {
|
implements Filter, NonEmbeddedServletContainerFactory {
|
||||||
|
|
||||||
private static Log logger = LogFactory.getLog(ErrorPageFilter.class);
|
private static Log logger = LogFactory.getLog(ErrorPageFilter.class);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue