You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2f815a907a
Update the existing tests to use the relocated `spring-boot-test` classes. Restructuring was achieved using the following command: find . -type f -name '*.java' -exec sed -i '' \ -e s/org.springframework.boot.test.ConfigFileApplicationContextInitializer/\ org.springframework.boot.test.context.ConfigFileApplicationContextInitializer/g \ -e s/org.springframework.boot.test.EnvironmentTestUtils/\ org.springframework.boot.test.util.EnvironmentTestUtils/g \ -e s/org.springframework.boot.test.IntegrationTest/\ org.springframework.boot.test.context.IntegrationTest/g \ -e s/org.springframework.boot.test.IntegrationTestPropertiesListener/\ org.springframework.boot.test.context.IntegrationTestPropertiesListener/g \ -e s/org.springframework.boot.test.OutputCapture/\ org.springframework.boot.test.rule.OutputCapture/g \ -e s/org.springframework.boot.test.SpringApplicationConfiguration/\ org.springframework.boot.test.context.SpringApplicationConfiguration/g \ -e s/org.springframework.boot.test.SpringApplicationContextLoader/\ org.springframework.boot.test.context.SpringApplicationContextLoader/g \ -e s/org.springframework.boot.test.SpringBootMockServletContext/\ org.springframework.boot.test.mock.web.SpringBootMockServletContext/g \ -e s/org.springframework.boot.test.TestRestTemplate/\ org.springframework.boot.test.web.client.TestRestTemplate/g \ -e s/org.springframework.boot.test.WebIntegrationTest/\ org.springframework.boot.test.context.web.WebIntegrationTest/g {} \; See gh-5293 |
9 years ago | |
---|---|---|
.. | ||
src | 9 years ago | |
README.adoc | ||
docker-compose.yml | ||
pom.xml | 9 years ago |
README.adoc
= Spring Boot sample with Redis export for metrics. Start redis, e.g. with [Docker Compose]() [source,indent=0] ---- $ docker-compose up ---- Run the app and ping the home page (http://localhost:8080) a few times. Go and look at the result in Redis, e.g. [source,indent=0] ---- $ redis-cli 127.0.0.1:6379> keys * 1) "keys.spring.metrics" 2) "spring.metrics.counter.status.200.root" 3) "spring.metrics.gauge.response.root" 127.0.0.1:6379> zrange keys.spring.metrics 0 0 WITHSCORES 1) "spring.metrics.counter.status.200.root" 2) "4" ---- There is also an `AggregateMetricReader` with public metrics in the application context, and you can see the result in the "/metrics" (metrics with names in "aggregate.*"). The way the Redis repository was set up (with a random key in the metric names) makes the aggregates work across restarts of the same application, or across a scaled up application running in multiple processes. E.g. [source,indent=0] ---- $ curl localhost:8080/metrics { ... "aggregate.application.counter.status.200.metrics": 12, "aggregate.application.counter.status.200.root": 29, "aggregate.application.gauge.response.metrics": 43, "aggregate.application.gauge.response.root": 5, "counter.status.200.root": 2, "counter.status.200.metrics": 1, "gauge.response.metrics": 43, "gauge.response.root": 5 } ----