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

Change for counters – introducing ConcurrentGauge

Counters in Metrics 1.x had two functions:

  • To provide a measure for the number of concurrent invocations
  • As a metric that can count up to the number of transactions committed, for example

Unfortunately, the first way was the default when using the annotation without specifying the monotonic keyword, which is unexpected and was confusing a lot of users. The second version of this also had its issues, as a counter value could also decrease at will, which violates the understanding that a counter is a monotonically increasing metric.

For this reason, the Metrics working group has decided to change the behavior of counters so they only work as monotonically increasing metrics and to defer the ...

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