O'Reilly logo

Hands-On Enterprise Java Microservices with Eclipse MicroProfile by Scott Stark, Antoine Sabot-Durand, Pavol Loffay, Jeff Mesnil, Heiko W. Rupp, Cesar Saavedra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required