Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-2285 Microprofile Examples
  3. TOMEE-2284

MicroProfile Metrics Example for @Metered

    XMLWordPrintableJSON

    Details

      Description

      We would like to have an example for MicroProfile Metrics @Metered annotation.

      Here is a quick tutorial on MicroProfile Metrics if you are not aware:

      https://www.tomitribe.com/blog/getting-started-with-microprofile-metrics/

      Fork / clone the TomEE project from here:

      https://github.com/apache/tomee

      Example name should be mp-metrics-metered, following the standard already in the project.

      All the examples are in:

      https://github.com/apache/tomee/tree/master/examples

      See this example of @Counted for reference:

      https://github.com/apache/tomee/tree/master/examples/mp-metrics-counted

      See these two PRs for the diff for @Counted, it will help you see how simple it is:

      https://github.com/apache/tomee/pull/203

      https://github.com/apache/tomee/pull/207

      What you have to do is:

      1 - Create a method in the WeatherService class with @Metered

      2 - Have a WeatherServiceTest for the GET and OPTIONS scenarios of @Metered

      3 - Make sure you have tests for Prometheus and JSON formats

      4 - Make sure all the tests pass

      After that submit a PR and we'll review it.

       

       

        Attachments

        1. image-2018-11-23-11-06-41-322.png
          51 kB
          Ferdi Saptanera
        2. image-2018-11-23-11-07-37-555.png
          81 kB
          Ferdi Saptanera

          Activity

            People

            • Assignee:
              ivanjunckes Ivan Junckes Filho
              Reporter:
              ivanjunckes Ivan Junckes Filho
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: