This adds the mpMetrics-1.0 feature to the Liberty server and adds metrics to several example locations.
It uses a Timer through the @Timed annotation to measure the time each HashMapDAO method takes. It stores these values in a histogram so trends can be seen. It also uses a Counter through the @Counted annotation to count the number of times each REST endpoint has been requested since the server has started. In addition, a suite of base metrics about the server are collected by default.
The data collected by all of these metrics can be accessed from the /metrics endpoint, which is linked from the Votes page of the web application. By default, it is output in a format known to Prometheus; however, if the endpoint is requested with Accept: application/json in the header, JSON will be sent.
This adds the mpMetrics-1.0 feature to the Liberty server and adds metrics to several example locations.
It uses a
Timer
through the@Timed
annotation to measure the time each HashMapDAO method takes. It stores these values in a histogram so trends can be seen. It also uses aCounter
through the@Counted
annotation to count the number of times each REST endpoint has been requested since the server has started. In addition, a suite of base metrics about the server are collected by default.The data collected by all of these metrics can be accessed from the /metrics endpoint, which is linked from the Votes page of the web application. By default, it is output in a format known to Prometheus; however, if the endpoint is requested with
Accept: application/json
in the header, JSON will be sent.