The Metrics tab

The Metrics tab shows the following view containing three links:

The first link accesses the following endpoint in the io.packt.sample.metric.MetricController class:

@Path("timed")@Timed(name = "timed-request")@GET@Produces(MediaType.TEXT_PLAIN)public String timedRequest() {    long start = System.currentTimeMillis();    // Demo, not production style    int wait = new Random().nextInt(1000);    try {        Thread.sleep(wait);    } catch (InterruptedException e) {        // Demo        e.printStackTrace();    }    long end = System.currentTimeMillis();    long delay = end - start;    doIncrement();    long count = getCustomerCount();    return String.format("MetricController#timedRequest, ...

Get Hands-On Enterprise Java Microservices with Eclipse MicroProfile now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.