Fixes to actuator metrics
- Quick fix to get something out from new boot 2.x metrics. - Change source to java 8 compat - Add new micrometer deps to build - Docs and further changes will get done when new boot metric system completes. - Fixes #410
This commit is contained in:
@@ -131,9 +131,9 @@ project('spring-statemachine-samples-monitoring') {
|
||||
description = 'Spring State Machine Monitoring Sample'
|
||||
dependencies {
|
||||
compile project(":spring-statemachine-boot")
|
||||
compile("org.springframework.boot:spring-boot-starter-actuator")
|
||||
compile("org.springframework.boot:spring-boot-starter-web")
|
||||
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
|
||||
compile("org.springframework.boot:spring-boot-starter-security")
|
||||
testCompile("com.jayway.jsonpath:json-path")
|
||||
testCompile("com.jayway.jsonpath:json-path-assert")
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
management:
|
||||
security:
|
||||
enabled: false
|
||||
security:
|
||||
basic:
|
||||
enabled: false
|
||||
spring:
|
||||
autoconfigure:
|
||||
exclude:
|
||||
- org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
|
||||
endpoints:
|
||||
default:
|
||||
web:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 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.
|
||||
@@ -15,11 +15,13 @@
|
||||
*/
|
||||
package demo.monitoring;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.hasItems;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.hamcrest.Matchers.allOf;
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
@@ -80,7 +82,11 @@ public class MonitoringTests {
|
||||
andExpect(status().isOk());
|
||||
mvc.
|
||||
perform(get("/application/metrics")).
|
||||
andExpect(jsonPath("$.['counter.ssm.transition.INITIAL_S1.transit']", is(1)));
|
||||
andExpect(jsonPath("$.names", hasItems("ssm.transition.duration", "ssm.transition.transit")));
|
||||
mvc.
|
||||
perform(get("/application/metrics/ssm.transition.duration")).
|
||||
andDo(print()).
|
||||
andExpect(jsonPath("$['ssmTransitionDuration.transitionname.INITIAL_S1']", notNullValue()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2017 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.
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package demo.web;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
||||
@@ -41,7 +43,7 @@ public class WebSocketConfig extends AbstractSessionWebSocketMessageBrokerConfig
|
||||
|
||||
@Bean
|
||||
public MapSessionRepository mapSessionRepository() {
|
||||
return new MapSessionRepository();
|
||||
return new MapSessionRepository(new ConcurrentHashMap<>());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user