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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.