GitHub user ferdisn opened a pull request:
https://github.com/apache/tomee/pull/215
WIP mp-metrics-metered
Hi @ivanjunckes I've made this module and ran it with `tomee:run`
I then hit the API with Postman, and here is my finding:
Prometheus format
```
# TYPE application:daily_status_seconds_count meter
application:daily_status_seconds_count 6.0E-8
# TYPE application:daily_status_rate_per_second meter
application:daily_status_rate_per_second 0.0
# TYPE application:daily_status_one_min_rate_per_second meter
application:daily_status_one_min_rate_per_second 1.9999999999999997E-19
# TYPE application:daily_status_five_min_rate_per_second meter
application:daily_status_five_min_rate_per_second 1.9999999999999997E-19
# TYPE application:daily_status_fifteen_min_rate_per_second meter
application:daily_status_fifteen_min_rate_per_second 1.9999999999999997E-19
```
JSON format
```json
{
"dailyStatus": {
"oneMinuteRate": 2.8216057496353807e-12,
"rate15": {
"alpha": 0.7134952031398099,
"initialized": true,
"interval": 300000000000,
"updates": {},
"value": 2.736166620796627e-13
},
"rate5": {
"alpha": 0.34075936979955623,
"initialized": true,
"interval": 300000000000,
"updates": {},
"value": 1.4486606950235942e-12
},
"unit": "minutes",
"fifteenMinuteRate": 2.736166620796627e-13,
"rate1": {
"alpha": 0.07995558537067671,
"initialized": true,
"interval": 300000000000,
"updates": {},
"value": 2.8216057496353807e-12
},
"fiveMinuteRate": 1.4486606950235942e-12,
"meanRate": 0,
"lastUpdate": {
"andDecrement": 5188059248904524,
"opaque": 5188059248904523,
"andIncrement": 5188059248904523,
"plain": 5188059248904524,
"value": 5188059248904524,
"acquire": 5188059248904524
},
"count": 1,
"initNs": 5187070527008724
}
}
```
Both are really different from each other. Another thing, JSON format does
not conform with the example in the specification.
What should I do, now? Obviously making Test class wouldn't do it any good.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ferdisn/tomee mp-metrics-metered
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tomee/pull/215.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #215
----
commit 4d75a99314ec595e37534fee9cf66d02564ac2d4
Author: Ferdi <github@...>
Date: 2018-11-23T03:12:50Z
Create mp-metrics-metered example pom.xml file
commit b71a312376222f7c50edf81ab3d8413ccd5c5eb3
Author: Ferdi <github@...>
Date: 2018-11-23T03:13:17Z
Create WeatherService class with @Metered annotation
----
---