Skip to content

Commit

Permalink
add metrics to SE quickstarts (helidon-io#7114)
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <thibault.vallin@oracle.com>
  • Loading branch information
tvallin authored Jun 27, 2023
1 parent a9dabfb commit 8c5aff0
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ curl -X GET http://localhost:8080/greet/Jose
<value key="groupId">jakarta.json</value>
<value key="artifactId">jakarta.json-api</value>
</map>
<map order="999">
<value key="groupId">io.helidon.nima.observe</value>
<value key="artifactId">helidon-nima-observe-metrics</value>
</map>
<map order="999">
<value key="groupId">io.helidon.metrics</value>
<value key="artifactId">helidon-metrics</value>
</map>
</list>
<list key="Main-helidon-imports">
<value>io.helidon.health.checks.DeadlockHealthCheck</value>
Expand All @@ -76,7 +84,7 @@ curl -X GET http://localhost:8080/greet/Jose
<list key="Main-routing">
<value><![CDATA[
ObserveFeature observe = ObserveFeature.builder()
.useSystemServices(false)
.useSystemServices(true)
.addProvider(HealthObserveProvider.create(HealthFeature.builder()
.useSystemServices(false)
.addCheck(HeapMemoryHealthCheck.create())
Expand Down Expand Up @@ -121,6 +129,13 @@ curl -X GET http://localhost:8080/greet/Jose
assertThat(response.status(), is(Http.Status.NO_CONTENT_204));
}
}
@Test
void testMetricsObserver() {
try (Http1ClientResponse response = client.get("/observe/metrics").request()) {
assertThat(response.status(), is(Http.Status.OK_200));
}
}
]]></value>
</list>
</model>
Expand Down
8 changes: 8 additions & 0 deletions examples/quickstarts/helidon-quickstart-se/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
<groupId>io.helidon.nima.observe</groupId>
<artifactId>helidon-nima-observe-health</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.nima.observe</groupId>
<artifactId>helidon-nima-observe-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.metrics</groupId>
<artifactId>helidon-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.nima.openapi</groupId>
<artifactId>helidon-nima-openapi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,11 @@ void testDeadlockHealthCheck() {
assertThat(response.status(), is(Http.Status.NO_CONTENT_204));
}
}

@Test
void testMetricsObserver() {
try (Http1ClientResponse response = client.get("/observe/metrics").request()) {
assertThat(response.status(), is(Http.Status.OK_200));
}
}
}
8 changes: 8 additions & 0 deletions examples/quickstarts/helidon-standalone-quickstart-se/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@
<groupId>io.helidon.nima.observe</groupId>
<artifactId>helidon-nima-observe-health</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.nima.observe</groupId>
<artifactId>helidon-nima-observe-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.metrics</groupId>
<artifactId>helidon-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-yaml</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ void testHealthObserver() {
assertThat(response.status(), is(Http.Status.NO_CONTENT_204));
}
}

@Test
void testDeadlockHealthCheck() {
try (Http1ClientResponse response = client.get("/observe/health/live/deadlock").request()) {
assertThat(response.status(), is(Http.Status.NO_CONTENT_204));
}
}

@Test
void testMetricsObserver() {
try (Http1ClientResponse response = client.get("/observe/metrics").request()) {
assertThat(response.status(), is(Http.Status.OK_200));
}
}
}

0 comments on commit 8c5aff0

Please sign in to comment.