Skip to content

Commit 39c28dd

Browse files
committed
Moved the counter
1 parent 2b8664e commit 39c28dd

File tree

1 file changed

+2
-2
lines changed
  • spring-boot/spring-boot-actuator/src/main/java/io/reflectoring/springboot/actuator/controllers

1 file changed

+2
-2
lines changed

spring-boot/spring-boot-actuator/src/main/java/io/reflectoring/springboot/actuator/controllers/OrderController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ public class OrderController {
2828
public List<Order> getOrders(@PathVariable(value = "customerId") String customerId) {
2929
System.out.println("Get orders requested for customer: " + customerId);
3030

31-
registry.counter("orders.placed.counter").increment();
32-
3331
// Dummy order history for example purpose
3432
OrderLineItem orderLineItem1 = new OrderLineItem();
3533
orderLineItem1.setProductId(UUID.randomUUID().toString());
@@ -66,6 +64,8 @@ public OrderCreatedResponse placeOrder(@PathVariable(value = "customerId") Strin
6664
@RequestBody Order order) {
6765
System.out.println("Place order requested for customer: " + customerId);
6866

67+
registry.counter("orders.placed.counter").increment();
68+
6969
OrderCreatedResponse response = new OrderCreatedResponse();
7070
response.setOrderId(UUID.randomUUID().toString());
7171
response.setCustomerId(customerId);

0 commit comments

Comments
 (0)