You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Ivan Junckes Filho <iv...@gmail.com> on 2018/11/19 19:51:14 UTC

Microprofile Metrics Example

Hey guys, just to let you know that I created a Microprofile Metrics
Example under Tomee.

I am still working on that and I will provide more test scenarios.

Here is the PR if you want to review the work so far:
https://github.com/apache/tomee/pull/203

Feel free to merge if you think this can be done incrementally.

Re: Microprofile Metrics Example

Posted by Daniel Cunha <da...@apache.org>.
Hi,

Yeah the sample is cool. I just push my +1.
But, I'm agree with Jon, we can improve de Readme to make it better.

Nice work man. :)

Em seg, 19 de nov de 2018 5:12 PM, Ivan Junckes Filho <ivanjunckes@gmail.com
escreveu:

> Done Jon, I will keep improving it.
>
> On Mon, Nov 19, 2018 at 6:01 PM Jonathan Gallimore <
> jonathan.gallimore@gmail.com> wrote:
>
> > Very cool. I'd suggest adding a README like the other examples have, as
> > that can be linked from the website, and they usually provide great
> > documentation.
> >
> > Jon
> >
> > On Mon, 19 Nov 2018, 19:51 Ivan Junckes Filho <ivanjunckes@gmail.com
> > wrote:
> >
> > > Hey guys, just to let you know that I created a Microprofile Metrics
> > > Example under Tomee.
> > >
> > > I am still working on that and I will provide more test scenarios.
> > >
> > > Here is the PR if you want to review the work so far:
> > > https://github.com/apache/tomee/pull/203
> > >
> > > Feel free to merge if you think this can be done incrementally.
> > >
> >
>

Re: Microprofile Metrics Example

Posted by Ivan Junckes Filho <iv...@gmail.com>.
Thanks David, these are really great tips and I will follow them.


On Mon, Nov 19, 2018 at 10:43 PM David Blevins <da...@gmail.com>
wrote:

> Agree with the README comments.  Another great reference is the Simple
> WebService example which has payloads.
>
>  -
> https://github.com/apache/tomee/tree/master/examples/simple-webservice#inspecting-the-messages
>
> I think people new to MicroProfile metrics will want to see what the
> metrics look like, so similarly showing payloads would be great.
>
> Often when I'm starting an bunch of examples, I try to plan a few in
> advance so I can come up with a forward-thinking naming convention should
> be adjusted.  There's an informal naming convention in there already which
> is basically:
>
>  - simple-<topic>              // introduction
>  - <topic>-<subtopic1>         // very specific lesson
>  - <topic>-<subtopic2>         // very specific lesson
>  - <topic>-<subtopic3>         // very specific lesson
>
> For example:
>
>  - simple-webservice              // introduction
>  - webservice-attachments
>  - webservice-handlerchain
>  - webservice-holder
>
>  - cdi-basic                      // slightly bucks convention
>  - cdi-application-scope
>  - cdi-session-scope
>  - cdi-request-scope
>  - cdi-events
>  - cdi-interceptors
>  - cdi-decorators                 // this one doesn't actually exist!!!
> contribution opportunity! :)
>
> My gut says "rest" is not the topic and shouldn't be first in the
> directory name and probably doesn't need to be mentioned at all.  The
> second thought is there are very specific annotations and metric types, so
> each of these could be an example.  This might give you:
>
>  - mp-metrics-basic || simple-mp-metrics      // whichever convention we
> think is best
>  - mp-metrics-counted
>  - mp-metrics-guague
>  - mp-metrics-timed
>
> We've generally had a policy to attempt to keep examples as simple and
> trivial as possible.  For CDI we have one example for each scope
> annotation.  Doing the same with the metrics annotation would allow you to
> focus on the nuances of that annotation. A few advantages would be:
>
>  - search engine optimization. having the annotation in the page title
> will put your content first when someone searches "mp metrics guague"
>  - people can send the links to each other with "this is the metric type
> you want for X task.  Here's the simplest example. The other types are
> ignorable for X"
>  - people don't have to digest all of MP Metrics at once.  we typically
> shoot for 5 minutes of "presentation time" per example.
>
> I vividly remember a presentation I did at JAX London where I talked about
> OpenEJB for the first half, then just started showing examples for the
> second half.  Each five minutes.  I showed what the room wanted to see.  30
> minutes go by and the session is technically over and it's lunch break, but
> people aren't leaving.  So I'm like, "do you want to see more?" and people
> stay glued to their seat and keep asking for stuff.  I showed another 20-30
> minutes of 5 minute examples before I basically told everyone to go eat as
> the conference organizer who was standing in the back of the room the
> entire time gave me the nod to force everyone get out of their seats.  It
> was the biggest room and all the food and staff were just sitting there.
>
> Anyway, that's the power of bite-sized examples.  You can put them
> together like legos and make any shape presentation you want.
>
> If you want to do a MicroProfile general introduction, you grab the
> "simple foo" of each topic.  If you want to do a dedicated MicroProfile
> Metrics talk, you pick your favorite 5 or 8 mp-metrics-* examples.
>
> Doing it like that you can easily bang out a bunch of examples in a few
> days or a week. Then have the ability to walk into almost any room and give
> an ad-hoc MicroProfile presentation tailored to the people in front of you.
>
>
> --
> David Blevins
> http://twitter.com/dblevins
> http://www.tomitribe.com
>
> > On Nov 19, 2018, at 12:24 PM, Jonathan Gallimore <
> jonathan.gallimore@gmail.com> wrote:
> >
> > Great stuff! Do checkout these - they're a pretty good format to follow:
> >
> https://github.com/apache/tomee/blob/master/examples/simple-stateless/README.md
> > .
> >
> > I've merged your PR, and we can continue to iterate on it. Thanks for the
> > contribution, I think its great to see some MicroProfile examples. I
> found
> > the examples really helpful when getting started with TomEE/OpenEJB
> myself,
> > and I'm sure folks will love seeing new examples for MicroProfile!
> >
> > Jon
> >
> > On Mon, Nov 19, 2018 at 8:12 PM Ivan Junckes Filho <
> ivanjunckes@gmail.com>
> > wrote:
> >
> >> Done Jon, I will keep improving it.
> >>
> >> On Mon, Nov 19, 2018 at 6:01 PM Jonathan Gallimore <
> >> jonathan.gallimore@gmail.com> wrote:
> >>
> >>> Very cool. I'd suggest adding a README like the other examples have, as
> >>> that can be linked from the website, and they usually provide great
> >>> documentation.
> >>>
> >>> Jon
> >>>
> >>> On Mon, 19 Nov 2018, 19:51 Ivan Junckes Filho <ivanjunckes@gmail.com
> >>> wrote:
> >>>
> >>>> Hey guys, just to let you know that I created a Microprofile Metrics
> >>>> Example under Tomee.
> >>>>
> >>>> I am still working on that and I will provide more test scenarios.
> >>>>
> >>>> Here is the PR if you want to review the work so far:
> >>>> https://github.com/apache/tomee/pull/203
> >>>>
> >>>> Feel free to merge if you think this can be done incrementally.
> >>>>
> >>>
> >>
>
>

Re: Microprofile Metrics Example

Posted by Ivan Junckes Filho <iv...@gmail.com>.
Thanks Jon.

Cesar, I couldn't reproduce the monotonic=false as json here. It returns
Prometheus if I don't send the header.

Can you check this again?

On Tue, Nov 20, 2018 at 2:41 PM Jonathan Gallimore <
jonathan.gallimore@gmail.com> wrote:

> Looks great. I'll merge it in. Thanks for the contribution Ivan!
>
> On Tue, Nov 20, 2018 at 4:33 PM Daniel Cunha <da...@gmail.com> wrote:
>
> > Hi Ivan,
> >
> > really nice, the content on README is much better now. Nice work man!
> > Just pushing my +1 for your PR. :)
> >
> > Em ter, 20 de nov de 2018 às 13:14, Ivan Junckes Filho <
> > ivanjunckes@gmail.com> escreveu:
> >
> > > Hey guys, could you please review this?
> > >
> > > https://github.com/apache/tomee/pull/207
> > >
> > > This is the project for counted. I will add more projects for other
> types
> > > of metrics during the week.
> > >
> > > I would like to know if the README is good enough or if need more
> > changes.
> > >
> > > Thanks.
> > >
> > > On Tue, Nov 20, 2018 at 11:30 AM Richard Monson-Haefel <
> > > monsonhaefel@gmail.com> wrote:
> > >
> > > > Hi David,
> > > >
> > > > This was really informative and useful. Thank you!
> > > >
> > > > Richard
> > > >
> > > > On Mon, Nov 19, 2018 at 6:43 PM David Blevins <
> david.blevins@gmail.com
> > >
> > > > wrote:
> > > >
> > > > > Agree with the README comments.  Another great reference is the
> > Simple
> > > > > WebService example which has payloads.
> > > > >
> > > > >  -
> > > > >
> > > >
> > >
> >
> https://github.com/apache/tomee/tree/master/examples/simple-webservice#inspecting-the-messages
> > > > >
> > > > > I think people new to MicroProfile metrics will want to see what
> the
> > > > > metrics look like, so similarly showing payloads would be great.
> > > > >
> > > > > Often when I'm starting an bunch of examples, I try to plan a few
> in
> > > > > advance so I can come up with a forward-thinking naming convention
> > > should
> > > > > be adjusted.  There's an informal naming convention in there
> already
> > > > which
> > > > > is basically:
> > > > >
> > > > >  - simple-<topic>              // introduction
> > > > >  - <topic>-<subtopic1>         // very specific lesson
> > > > >  - <topic>-<subtopic2>         // very specific lesson
> > > > >  - <topic>-<subtopic3>         // very specific lesson
> > > > >
> > > > > For example:
> > > > >
> > > > >  - simple-webservice              // introduction
> > > > >  - webservice-attachments
> > > > >  - webservice-handlerchain
> > > > >  - webservice-holder
> > > > >
> > > > >  - cdi-basic                      // slightly bucks convention
> > > > >  - cdi-application-scope
> > > > >  - cdi-session-scope
> > > > >  - cdi-request-scope
> > > > >  - cdi-events
> > > > >  - cdi-interceptors
> > > > >  - cdi-decorators                 // this one doesn't actually
> > exist!!!
> > > > > contribution opportunity! :)
> > > > >
> > > > > My gut says "rest" is not the topic and shouldn't be first in the
> > > > > directory name and probably doesn't need to be mentioned at all.
> The
> > > > > second thought is there are very specific annotations and metric
> > types,
> > > > so
> > > > > each of these could be an example.  This might give you:
> > > > >
> > > > >  - mp-metrics-basic || simple-mp-metrics      // whichever
> convention
> > > we
> > > > > think is best
> > > > >  - mp-metrics-counted
> > > > >  - mp-metrics-guague
> > > > >  - mp-metrics-timed
> > > > >
> > > > > We've generally had a policy to attempt to keep examples as simple
> > and
> > > > > trivial as possible.  For CDI we have one example for each scope
> > > > > annotation.  Doing the same with the metrics annotation would allow
> > you
> > > > to
> > > > > focus on the nuances of that annotation. A few advantages would be:
> > > > >
> > > > >  - search engine optimization. having the annotation in the page
> > title
> > > > > will put your content first when someone searches "mp metrics
> guague"
> > > > >  - people can send the links to each other with "this is the metric
> > > type
> > > > > you want for X task.  Here's the simplest example. The other types
> > are
> > > > > ignorable for X"
> > > > >  - people don't have to digest all of MP Metrics at once.  we
> > typically
> > > > > shoot for 5 minutes of "presentation time" per example.
> > > > >
> > > > > I vividly remember a presentation I did at JAX London where I
> talked
> > > > about
> > > > > OpenEJB for the first half, then just started showing examples for
> > the
> > > > > second half.  Each five minutes.  I showed what the room wanted to
> > see.
> > > > 30
> > > > > minutes go by and the session is technically over and it's lunch
> > break,
> > > > but
> > > > > people aren't leaving.  So I'm like, "do you want to see more?" and
> > > > people
> > > > > stay glued to their seat and keep asking for stuff.  I showed
> another
> > > > 20-30
> > > > > minutes of 5 minute examples before I basically told everyone to go
> > eat
> > > > as
> > > > > the conference organizer who was standing in the back of the room
> the
> > > > > entire time gave me the nod to force everyone get out of their
> seats.
> > > It
> > > > > was the biggest room and all the food and staff were just sitting
> > > there.
> > > > >
> > > > > Anyway, that's the power of bite-sized examples.  You can put them
> > > > > together like legos and make any shape presentation you want.
> > > > >
> > > > > If you want to do a MicroProfile general introduction, you grab the
> > > > > "simple foo" of each topic.  If you want to do a dedicated
> > MicroProfile
> > > > > Metrics talk, you pick your favorite 5 or 8 mp-metrics-* examples.
> > > > >
> > > > > Doing it like that you can easily bang out a bunch of examples in a
> > few
> > > > > days or a week. Then have the ability to walk into almost any room
> > and
> > > > give
> > > > > an ad-hoc MicroProfile presentation tailored to the people in front
> > of
> > > > you.
> > > > >
> > > > >
> > > > > --
> > > > > David Blevins
> > > > > http://twitter.com/dblevins
> > > > > http://www.tomitribe.com
> > > > >
> > > > > > On Nov 19, 2018, at 12:24 PM, Jonathan Gallimore <
> > > > > jonathan.gallimore@gmail.com> wrote:
> > > > > >
> > > > > > Great stuff! Do checkout these - they're a pretty good format to
> > > > follow:
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/apache/tomee/blob/master/examples/simple-stateless/README.md
> > > > > > .
> > > > > >
> > > > > > I've merged your PR, and we can continue to iterate on it. Thanks
> > for
> > > > the
> > > > > > contribution, I think its great to see some MicroProfile
> examples.
> > I
> > > > > found
> > > > > > the examples really helpful when getting started with
> TomEE/OpenEJB
> > > > > myself,
> > > > > > and I'm sure folks will love seeing new examples for
> MicroProfile!
> > > > > >
> > > > > > Jon
> > > > > >
> > > > > > On Mon, Nov 19, 2018 at 8:12 PM Ivan Junckes Filho <
> > > > > ivanjunckes@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > >> Done Jon, I will keep improving it.
> > > > > >>
> > > > > >> On Mon, Nov 19, 2018 at 6:01 PM Jonathan Gallimore <
> > > > > >> jonathan.gallimore@gmail.com> wrote:
> > > > > >>
> > > > > >>> Very cool. I'd suggest adding a README like the other examples
> > > have,
> > > > as
> > > > > >>> that can be linked from the website, and they usually provide
> > great
> > > > > >>> documentation.
> > > > > >>>
> > > > > >>> Jon
> > > > > >>>
> > > > > >>> On Mon, 19 Nov 2018, 19:51 Ivan Junckes Filho <
> > > ivanjunckes@gmail.com
> > > > > >>> wrote:
> > > > > >>>
> > > > > >>>> Hey guys, just to let you know that I created a Microprofile
> > > Metrics
> > > > > >>>> Example under Tomee.
> > > > > >>>>
> > > > > >>>> I am still working on that and I will provide more test
> > scenarios.
> > > > > >>>>
> > > > > >>>> Here is the PR if you want to review the work so far:
> > > > > >>>> https://github.com/apache/tomee/pull/203
> > > > > >>>>
> > > > > >>>> Feel free to merge if you think this can be done
> incrementally.
> > > > > >>>>
> > > > > >>>
> > > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
> >
> > --
> > Daniel "soro" Cunha
> > https://twitter.com/dvlc_
> >
>

Re: Microprofile Metrics Example

Posted by Jonathan Gallimore <jo...@gmail.com>.
Looks great. I'll merge it in. Thanks for the contribution Ivan!

On Tue, Nov 20, 2018 at 4:33 PM Daniel Cunha <da...@gmail.com> wrote:

> Hi Ivan,
>
> really nice, the content on README is much better now. Nice work man!
> Just pushing my +1 for your PR. :)
>
> Em ter, 20 de nov de 2018 às 13:14, Ivan Junckes Filho <
> ivanjunckes@gmail.com> escreveu:
>
> > Hey guys, could you please review this?
> >
> > https://github.com/apache/tomee/pull/207
> >
> > This is the project for counted. I will add more projects for other types
> > of metrics during the week.
> >
> > I would like to know if the README is good enough or if need more
> changes.
> >
> > Thanks.
> >
> > On Tue, Nov 20, 2018 at 11:30 AM Richard Monson-Haefel <
> > monsonhaefel@gmail.com> wrote:
> >
> > > Hi David,
> > >
> > > This was really informative and useful. Thank you!
> > >
> > > Richard
> > >
> > > On Mon, Nov 19, 2018 at 6:43 PM David Blevins <david.blevins@gmail.com
> >
> > > wrote:
> > >
> > > > Agree with the README comments.  Another great reference is the
> Simple
> > > > WebService example which has payloads.
> > > >
> > > >  -
> > > >
> > >
> >
> https://github.com/apache/tomee/tree/master/examples/simple-webservice#inspecting-the-messages
> > > >
> > > > I think people new to MicroProfile metrics will want to see what the
> > > > metrics look like, so similarly showing payloads would be great.
> > > >
> > > > Often when I'm starting an bunch of examples, I try to plan a few in
> > > > advance so I can come up with a forward-thinking naming convention
> > should
> > > > be adjusted.  There's an informal naming convention in there already
> > > which
> > > > is basically:
> > > >
> > > >  - simple-<topic>              // introduction
> > > >  - <topic>-<subtopic1>         // very specific lesson
> > > >  - <topic>-<subtopic2>         // very specific lesson
> > > >  - <topic>-<subtopic3>         // very specific lesson
> > > >
> > > > For example:
> > > >
> > > >  - simple-webservice              // introduction
> > > >  - webservice-attachments
> > > >  - webservice-handlerchain
> > > >  - webservice-holder
> > > >
> > > >  - cdi-basic                      // slightly bucks convention
> > > >  - cdi-application-scope
> > > >  - cdi-session-scope
> > > >  - cdi-request-scope
> > > >  - cdi-events
> > > >  - cdi-interceptors
> > > >  - cdi-decorators                 // this one doesn't actually
> exist!!!
> > > > contribution opportunity! :)
> > > >
> > > > My gut says "rest" is not the topic and shouldn't be first in the
> > > > directory name and probably doesn't need to be mentioned at all.  The
> > > > second thought is there are very specific annotations and metric
> types,
> > > so
> > > > each of these could be an example.  This might give you:
> > > >
> > > >  - mp-metrics-basic || simple-mp-metrics      // whichever convention
> > we
> > > > think is best
> > > >  - mp-metrics-counted
> > > >  - mp-metrics-guague
> > > >  - mp-metrics-timed
> > > >
> > > > We've generally had a policy to attempt to keep examples as simple
> and
> > > > trivial as possible.  For CDI we have one example for each scope
> > > > annotation.  Doing the same with the metrics annotation would allow
> you
> > > to
> > > > focus on the nuances of that annotation. A few advantages would be:
> > > >
> > > >  - search engine optimization. having the annotation in the page
> title
> > > > will put your content first when someone searches "mp metrics guague"
> > > >  - people can send the links to each other with "this is the metric
> > type
> > > > you want for X task.  Here's the simplest example. The other types
> are
> > > > ignorable for X"
> > > >  - people don't have to digest all of MP Metrics at once.  we
> typically
> > > > shoot for 5 minutes of "presentation time" per example.
> > > >
> > > > I vividly remember a presentation I did at JAX London where I talked
> > > about
> > > > OpenEJB for the first half, then just started showing examples for
> the
> > > > second half.  Each five minutes.  I showed what the room wanted to
> see.
> > > 30
> > > > minutes go by and the session is technically over and it's lunch
> break,
> > > but
> > > > people aren't leaving.  So I'm like, "do you want to see more?" and
> > > people
> > > > stay glued to their seat and keep asking for stuff.  I showed another
> > > 20-30
> > > > minutes of 5 minute examples before I basically told everyone to go
> eat
> > > as
> > > > the conference organizer who was standing in the back of the room the
> > > > entire time gave me the nod to force everyone get out of their seats.
> > It
> > > > was the biggest room and all the food and staff were just sitting
> > there.
> > > >
> > > > Anyway, that's the power of bite-sized examples.  You can put them
> > > > together like legos and make any shape presentation you want.
> > > >
> > > > If you want to do a MicroProfile general introduction, you grab the
> > > > "simple foo" of each topic.  If you want to do a dedicated
> MicroProfile
> > > > Metrics talk, you pick your favorite 5 or 8 mp-metrics-* examples.
> > > >
> > > > Doing it like that you can easily bang out a bunch of examples in a
> few
> > > > days or a week. Then have the ability to walk into almost any room
> and
> > > give
> > > > an ad-hoc MicroProfile presentation tailored to the people in front
> of
> > > you.
> > > >
> > > >
> > > > --
> > > > David Blevins
> > > > http://twitter.com/dblevins
> > > > http://www.tomitribe.com
> > > >
> > > > > On Nov 19, 2018, at 12:24 PM, Jonathan Gallimore <
> > > > jonathan.gallimore@gmail.com> wrote:
> > > > >
> > > > > Great stuff! Do checkout these - they're a pretty good format to
> > > follow:
> > > > >
> > > >
> > >
> >
> https://github.com/apache/tomee/blob/master/examples/simple-stateless/README.md
> > > > > .
> > > > >
> > > > > I've merged your PR, and we can continue to iterate on it. Thanks
> for
> > > the
> > > > > contribution, I think its great to see some MicroProfile examples.
> I
> > > > found
> > > > > the examples really helpful when getting started with TomEE/OpenEJB
> > > > myself,
> > > > > and I'm sure folks will love seeing new examples for MicroProfile!
> > > > >
> > > > > Jon
> > > > >
> > > > > On Mon, Nov 19, 2018 at 8:12 PM Ivan Junckes Filho <
> > > > ivanjunckes@gmail.com>
> > > > > wrote:
> > > > >
> > > > >> Done Jon, I will keep improving it.
> > > > >>
> > > > >> On Mon, Nov 19, 2018 at 6:01 PM Jonathan Gallimore <
> > > > >> jonathan.gallimore@gmail.com> wrote:
> > > > >>
> > > > >>> Very cool. I'd suggest adding a README like the other examples
> > have,
> > > as
> > > > >>> that can be linked from the website, and they usually provide
> great
> > > > >>> documentation.
> > > > >>>
> > > > >>> Jon
> > > > >>>
> > > > >>> On Mon, 19 Nov 2018, 19:51 Ivan Junckes Filho <
> > ivanjunckes@gmail.com
> > > > >>> wrote:
> > > > >>>
> > > > >>>> Hey guys, just to let you know that I created a Microprofile
> > Metrics
> > > > >>>> Example under Tomee.
> > > > >>>>
> > > > >>>> I am still working on that and I will provide more test
> scenarios.
> > > > >>>>
> > > > >>>> Here is the PR if you want to review the work so far:
> > > > >>>> https://github.com/apache/tomee/pull/203
> > > > >>>>
> > > > >>>> Feel free to merge if you think this can be done incrementally.
> > > > >>>>
> > > > >>>
> > > > >>
> > > >
> > > >
> > >
> >
>
>
> --
> Daniel "soro" Cunha
> https://twitter.com/dvlc_
>

Re: Microprofile Metrics Example

Posted by Daniel Cunha <da...@gmail.com>.
Hi Ivan,

really nice, the content on README is much better now. Nice work man!
Just pushing my +1 for your PR. :)

Em ter, 20 de nov de 2018 às 13:14, Ivan Junckes Filho <
ivanjunckes@gmail.com> escreveu:

> Hey guys, could you please review this?
>
> https://github.com/apache/tomee/pull/207
>
> This is the project for counted. I will add more projects for other types
> of metrics during the week.
>
> I would like to know if the README is good enough or if need more changes.
>
> Thanks.
>
> On Tue, Nov 20, 2018 at 11:30 AM Richard Monson-Haefel <
> monsonhaefel@gmail.com> wrote:
>
> > Hi David,
> >
> > This was really informative and useful. Thank you!
> >
> > Richard
> >
> > On Mon, Nov 19, 2018 at 6:43 PM David Blevins <da...@gmail.com>
> > wrote:
> >
> > > Agree with the README comments.  Another great reference is the Simple
> > > WebService example which has payloads.
> > >
> > >  -
> > >
> >
> https://github.com/apache/tomee/tree/master/examples/simple-webservice#inspecting-the-messages
> > >
> > > I think people new to MicroProfile metrics will want to see what the
> > > metrics look like, so similarly showing payloads would be great.
> > >
> > > Often when I'm starting an bunch of examples, I try to plan a few in
> > > advance so I can come up with a forward-thinking naming convention
> should
> > > be adjusted.  There's an informal naming convention in there already
> > which
> > > is basically:
> > >
> > >  - simple-<topic>              // introduction
> > >  - <topic>-<subtopic1>         // very specific lesson
> > >  - <topic>-<subtopic2>         // very specific lesson
> > >  - <topic>-<subtopic3>         // very specific lesson
> > >
> > > For example:
> > >
> > >  - simple-webservice              // introduction
> > >  - webservice-attachments
> > >  - webservice-handlerchain
> > >  - webservice-holder
> > >
> > >  - cdi-basic                      // slightly bucks convention
> > >  - cdi-application-scope
> > >  - cdi-session-scope
> > >  - cdi-request-scope
> > >  - cdi-events
> > >  - cdi-interceptors
> > >  - cdi-decorators                 // this one doesn't actually exist!!!
> > > contribution opportunity! :)
> > >
> > > My gut says "rest" is not the topic and shouldn't be first in the
> > > directory name and probably doesn't need to be mentioned at all.  The
> > > second thought is there are very specific annotations and metric types,
> > so
> > > each of these could be an example.  This might give you:
> > >
> > >  - mp-metrics-basic || simple-mp-metrics      // whichever convention
> we
> > > think is best
> > >  - mp-metrics-counted
> > >  - mp-metrics-guague
> > >  - mp-metrics-timed
> > >
> > > We've generally had a policy to attempt to keep examples as simple and
> > > trivial as possible.  For CDI we have one example for each scope
> > > annotation.  Doing the same with the metrics annotation would allow you
> > to
> > > focus on the nuances of that annotation. A few advantages would be:
> > >
> > >  - search engine optimization. having the annotation in the page title
> > > will put your content first when someone searches "mp metrics guague"
> > >  - people can send the links to each other with "this is the metric
> type
> > > you want for X task.  Here's the simplest example. The other types are
> > > ignorable for X"
> > >  - people don't have to digest all of MP Metrics at once.  we typically
> > > shoot for 5 minutes of "presentation time" per example.
> > >
> > > I vividly remember a presentation I did at JAX London where I talked
> > about
> > > OpenEJB for the first half, then just started showing examples for the
> > > second half.  Each five minutes.  I showed what the room wanted to see.
> > 30
> > > minutes go by and the session is technically over and it's lunch break,
> > but
> > > people aren't leaving.  So I'm like, "do you want to see more?" and
> > people
> > > stay glued to their seat and keep asking for stuff.  I showed another
> > 20-30
> > > minutes of 5 minute examples before I basically told everyone to go eat
> > as
> > > the conference organizer who was standing in the back of the room the
> > > entire time gave me the nod to force everyone get out of their seats.
> It
> > > was the biggest room and all the food and staff were just sitting
> there.
> > >
> > > Anyway, that's the power of bite-sized examples.  You can put them
> > > together like legos and make any shape presentation you want.
> > >
> > > If you want to do a MicroProfile general introduction, you grab the
> > > "simple foo" of each topic.  If you want to do a dedicated MicroProfile
> > > Metrics talk, you pick your favorite 5 or 8 mp-metrics-* examples.
> > >
> > > Doing it like that you can easily bang out a bunch of examples in a few
> > > days or a week. Then have the ability to walk into almost any room and
> > give
> > > an ad-hoc MicroProfile presentation tailored to the people in front of
> > you.
> > >
> > >
> > > --
> > > David Blevins
> > > http://twitter.com/dblevins
> > > http://www.tomitribe.com
> > >
> > > > On Nov 19, 2018, at 12:24 PM, Jonathan Gallimore <
> > > jonathan.gallimore@gmail.com> wrote:
> > > >
> > > > Great stuff! Do checkout these - they're a pretty good format to
> > follow:
> > > >
> > >
> >
> https://github.com/apache/tomee/blob/master/examples/simple-stateless/README.md
> > > > .
> > > >
> > > > I've merged your PR, and we can continue to iterate on it. Thanks for
> > the
> > > > contribution, I think its great to see some MicroProfile examples. I
> > > found
> > > > the examples really helpful when getting started with TomEE/OpenEJB
> > > myself,
> > > > and I'm sure folks will love seeing new examples for MicroProfile!
> > > >
> > > > Jon
> > > >
> > > > On Mon, Nov 19, 2018 at 8:12 PM Ivan Junckes Filho <
> > > ivanjunckes@gmail.com>
> > > > wrote:
> > > >
> > > >> Done Jon, I will keep improving it.
> > > >>
> > > >> On Mon, Nov 19, 2018 at 6:01 PM Jonathan Gallimore <
> > > >> jonathan.gallimore@gmail.com> wrote:
> > > >>
> > > >>> Very cool. I'd suggest adding a README like the other examples
> have,
> > as
> > > >>> that can be linked from the website, and they usually provide great
> > > >>> documentation.
> > > >>>
> > > >>> Jon
> > > >>>
> > > >>> On Mon, 19 Nov 2018, 19:51 Ivan Junckes Filho <
> ivanjunckes@gmail.com
> > > >>> wrote:
> > > >>>
> > > >>>> Hey guys, just to let you know that I created a Microprofile
> Metrics
> > > >>>> Example under Tomee.
> > > >>>>
> > > >>>> I am still working on that and I will provide more test scenarios.
> > > >>>>
> > > >>>> Here is the PR if you want to review the work so far:
> > > >>>> https://github.com/apache/tomee/pull/203
> > > >>>>
> > > >>>> Feel free to merge if you think this can be done incrementally.
> > > >>>>
> > > >>>
> > > >>
> > >
> > >
> >
>


-- 
Daniel "soro" Cunha
https://twitter.com/dvlc_

Re: Microprofile Metrics Example

Posted by Ivan Junckes Filho <iv...@gmail.com>.
Hey guys, could you please review this?

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

This is the project for counted. I will add more projects for other types
of metrics during the week.

I would like to know if the README is good enough or if need more changes.

Thanks.

On Tue, Nov 20, 2018 at 11:30 AM Richard Monson-Haefel <
monsonhaefel@gmail.com> wrote:

> Hi David,
>
> This was really informative and useful. Thank you!
>
> Richard
>
> On Mon, Nov 19, 2018 at 6:43 PM David Blevins <da...@gmail.com>
> wrote:
>
> > Agree with the README comments.  Another great reference is the Simple
> > WebService example which has payloads.
> >
> >  -
> >
> https://github.com/apache/tomee/tree/master/examples/simple-webservice#inspecting-the-messages
> >
> > I think people new to MicroProfile metrics will want to see what the
> > metrics look like, so similarly showing payloads would be great.
> >
> > Often when I'm starting an bunch of examples, I try to plan a few in
> > advance so I can come up with a forward-thinking naming convention should
> > be adjusted.  There's an informal naming convention in there already
> which
> > is basically:
> >
> >  - simple-<topic>              // introduction
> >  - <topic>-<subtopic1>         // very specific lesson
> >  - <topic>-<subtopic2>         // very specific lesson
> >  - <topic>-<subtopic3>         // very specific lesson
> >
> > For example:
> >
> >  - simple-webservice              // introduction
> >  - webservice-attachments
> >  - webservice-handlerchain
> >  - webservice-holder
> >
> >  - cdi-basic                      // slightly bucks convention
> >  - cdi-application-scope
> >  - cdi-session-scope
> >  - cdi-request-scope
> >  - cdi-events
> >  - cdi-interceptors
> >  - cdi-decorators                 // this one doesn't actually exist!!!
> > contribution opportunity! :)
> >
> > My gut says "rest" is not the topic and shouldn't be first in the
> > directory name and probably doesn't need to be mentioned at all.  The
> > second thought is there are very specific annotations and metric types,
> so
> > each of these could be an example.  This might give you:
> >
> >  - mp-metrics-basic || simple-mp-metrics      // whichever convention we
> > think is best
> >  - mp-metrics-counted
> >  - mp-metrics-guague
> >  - mp-metrics-timed
> >
> > We've generally had a policy to attempt to keep examples as simple and
> > trivial as possible.  For CDI we have one example for each scope
> > annotation.  Doing the same with the metrics annotation would allow you
> to
> > focus on the nuances of that annotation. A few advantages would be:
> >
> >  - search engine optimization. having the annotation in the page title
> > will put your content first when someone searches "mp metrics guague"
> >  - people can send the links to each other with "this is the metric type
> > you want for X task.  Here's the simplest example. The other types are
> > ignorable for X"
> >  - people don't have to digest all of MP Metrics at once.  we typically
> > shoot for 5 minutes of "presentation time" per example.
> >
> > I vividly remember a presentation I did at JAX London where I talked
> about
> > OpenEJB for the first half, then just started showing examples for the
> > second half.  Each five minutes.  I showed what the room wanted to see.
> 30
> > minutes go by and the session is technically over and it's lunch break,
> but
> > people aren't leaving.  So I'm like, "do you want to see more?" and
> people
> > stay glued to their seat and keep asking for stuff.  I showed another
> 20-30
> > minutes of 5 minute examples before I basically told everyone to go eat
> as
> > the conference organizer who was standing in the back of the room the
> > entire time gave me the nod to force everyone get out of their seats.  It
> > was the biggest room and all the food and staff were just sitting there.
> >
> > Anyway, that's the power of bite-sized examples.  You can put them
> > together like legos and make any shape presentation you want.
> >
> > If you want to do a MicroProfile general introduction, you grab the
> > "simple foo" of each topic.  If you want to do a dedicated MicroProfile
> > Metrics talk, you pick your favorite 5 or 8 mp-metrics-* examples.
> >
> > Doing it like that you can easily bang out a bunch of examples in a few
> > days or a week. Then have the ability to walk into almost any room and
> give
> > an ad-hoc MicroProfile presentation tailored to the people in front of
> you.
> >
> >
> > --
> > David Blevins
> > http://twitter.com/dblevins
> > http://www.tomitribe.com
> >
> > > On Nov 19, 2018, at 12:24 PM, Jonathan Gallimore <
> > jonathan.gallimore@gmail.com> wrote:
> > >
> > > Great stuff! Do checkout these - they're a pretty good format to
> follow:
> > >
> >
> https://github.com/apache/tomee/blob/master/examples/simple-stateless/README.md
> > > .
> > >
> > > I've merged your PR, and we can continue to iterate on it. Thanks for
> the
> > > contribution, I think its great to see some MicroProfile examples. I
> > found
> > > the examples really helpful when getting started with TomEE/OpenEJB
> > myself,
> > > and I'm sure folks will love seeing new examples for MicroProfile!
> > >
> > > Jon
> > >
> > > On Mon, Nov 19, 2018 at 8:12 PM Ivan Junckes Filho <
> > ivanjunckes@gmail.com>
> > > wrote:
> > >
> > >> Done Jon, I will keep improving it.
> > >>
> > >> On Mon, Nov 19, 2018 at 6:01 PM Jonathan Gallimore <
> > >> jonathan.gallimore@gmail.com> wrote:
> > >>
> > >>> Very cool. I'd suggest adding a README like the other examples have,
> as
> > >>> that can be linked from the website, and they usually provide great
> > >>> documentation.
> > >>>
> > >>> Jon
> > >>>
> > >>> On Mon, 19 Nov 2018, 19:51 Ivan Junckes Filho <ivanjunckes@gmail.com
> > >>> wrote:
> > >>>
> > >>>> Hey guys, just to let you know that I created a Microprofile Metrics
> > >>>> Example under Tomee.
> > >>>>
> > >>>> I am still working on that and I will provide more test scenarios.
> > >>>>
> > >>>> Here is the PR if you want to review the work so far:
> > >>>> https://github.com/apache/tomee/pull/203
> > >>>>
> > >>>> Feel free to merge if you think this can be done incrementally.
> > >>>>
> > >>>
> > >>
> >
> >
>

Re: Microprofile Metrics Example

Posted by Richard Monson-Haefel <mo...@gmail.com>.
Hi David,

This was really informative and useful. Thank you!

Richard

On Mon, Nov 19, 2018 at 6:43 PM David Blevins <da...@gmail.com>
wrote:

> Agree with the README comments.  Another great reference is the Simple
> WebService example which has payloads.
>
>  -
> https://github.com/apache/tomee/tree/master/examples/simple-webservice#inspecting-the-messages
>
> I think people new to MicroProfile metrics will want to see what the
> metrics look like, so similarly showing payloads would be great.
>
> Often when I'm starting an bunch of examples, I try to plan a few in
> advance so I can come up with a forward-thinking naming convention should
> be adjusted.  There's an informal naming convention in there already which
> is basically:
>
>  - simple-<topic>              // introduction
>  - <topic>-<subtopic1>         // very specific lesson
>  - <topic>-<subtopic2>         // very specific lesson
>  - <topic>-<subtopic3>         // very specific lesson
>
> For example:
>
>  - simple-webservice              // introduction
>  - webservice-attachments
>  - webservice-handlerchain
>  - webservice-holder
>
>  - cdi-basic                      // slightly bucks convention
>  - cdi-application-scope
>  - cdi-session-scope
>  - cdi-request-scope
>  - cdi-events
>  - cdi-interceptors
>  - cdi-decorators                 // this one doesn't actually exist!!!
> contribution opportunity! :)
>
> My gut says "rest" is not the topic and shouldn't be first in the
> directory name and probably doesn't need to be mentioned at all.  The
> second thought is there are very specific annotations and metric types, so
> each of these could be an example.  This might give you:
>
>  - mp-metrics-basic || simple-mp-metrics      // whichever convention we
> think is best
>  - mp-metrics-counted
>  - mp-metrics-guague
>  - mp-metrics-timed
>
> We've generally had a policy to attempt to keep examples as simple and
> trivial as possible.  For CDI we have one example for each scope
> annotation.  Doing the same with the metrics annotation would allow you to
> focus on the nuances of that annotation. A few advantages would be:
>
>  - search engine optimization. having the annotation in the page title
> will put your content first when someone searches "mp metrics guague"
>  - people can send the links to each other with "this is the metric type
> you want for X task.  Here's the simplest example. The other types are
> ignorable for X"
>  - people don't have to digest all of MP Metrics at once.  we typically
> shoot for 5 minutes of "presentation time" per example.
>
> I vividly remember a presentation I did at JAX London where I talked about
> OpenEJB for the first half, then just started showing examples for the
> second half.  Each five minutes.  I showed what the room wanted to see.  30
> minutes go by and the session is technically over and it's lunch break, but
> people aren't leaving.  So I'm like, "do you want to see more?" and people
> stay glued to their seat and keep asking for stuff.  I showed another 20-30
> minutes of 5 minute examples before I basically told everyone to go eat as
> the conference organizer who was standing in the back of the room the
> entire time gave me the nod to force everyone get out of their seats.  It
> was the biggest room and all the food and staff were just sitting there.
>
> Anyway, that's the power of bite-sized examples.  You can put them
> together like legos and make any shape presentation you want.
>
> If you want to do a MicroProfile general introduction, you grab the
> "simple foo" of each topic.  If you want to do a dedicated MicroProfile
> Metrics talk, you pick your favorite 5 or 8 mp-metrics-* examples.
>
> Doing it like that you can easily bang out a bunch of examples in a few
> days or a week. Then have the ability to walk into almost any room and give
> an ad-hoc MicroProfile presentation tailored to the people in front of you.
>
>
> --
> David Blevins
> http://twitter.com/dblevins
> http://www.tomitribe.com
>
> > On Nov 19, 2018, at 12:24 PM, Jonathan Gallimore <
> jonathan.gallimore@gmail.com> wrote:
> >
> > Great stuff! Do checkout these - they're a pretty good format to follow:
> >
> https://github.com/apache/tomee/blob/master/examples/simple-stateless/README.md
> > .
> >
> > I've merged your PR, and we can continue to iterate on it. Thanks for the
> > contribution, I think its great to see some MicroProfile examples. I
> found
> > the examples really helpful when getting started with TomEE/OpenEJB
> myself,
> > and I'm sure folks will love seeing new examples for MicroProfile!
> >
> > Jon
> >
> > On Mon, Nov 19, 2018 at 8:12 PM Ivan Junckes Filho <
> ivanjunckes@gmail.com>
> > wrote:
> >
> >> Done Jon, I will keep improving it.
> >>
> >> On Mon, Nov 19, 2018 at 6:01 PM Jonathan Gallimore <
> >> jonathan.gallimore@gmail.com> wrote:
> >>
> >>> Very cool. I'd suggest adding a README like the other examples have, as
> >>> that can be linked from the website, and they usually provide great
> >>> documentation.
> >>>
> >>> Jon
> >>>
> >>> On Mon, 19 Nov 2018, 19:51 Ivan Junckes Filho <ivanjunckes@gmail.com
> >>> wrote:
> >>>
> >>>> Hey guys, just to let you know that I created a Microprofile Metrics
> >>>> Example under Tomee.
> >>>>
> >>>> I am still working on that and I will provide more test scenarios.
> >>>>
> >>>> Here is the PR if you want to review the work so far:
> >>>> https://github.com/apache/tomee/pull/203
> >>>>
> >>>> Feel free to merge if you think this can be done incrementally.
> >>>>
> >>>
> >>
>
>

Re: Microprofile Metrics Example

Posted by David Blevins <da...@gmail.com>.
Agree with the README comments.  Another great reference is the Simple WebService example which has payloads.

 - https://github.com/apache/tomee/tree/master/examples/simple-webservice#inspecting-the-messages

I think people new to MicroProfile metrics will want to see what the metrics look like, so similarly showing payloads would be great.

Often when I'm starting an bunch of examples, I try to plan a few in advance so I can come up with a forward-thinking naming convention should be adjusted.  There's an informal naming convention in there already which is basically:

 - simple-<topic>              // introduction
 - <topic>-<subtopic1>         // very specific lesson
 - <topic>-<subtopic2>         // very specific lesson
 - <topic>-<subtopic3>         // very specific lesson

For example:

 - simple-webservice              // introduction
 - webservice-attachments
 - webservice-handlerchain
 - webservice-holder

 - cdi-basic                      // slightly bucks convention
 - cdi-application-scope
 - cdi-session-scope
 - cdi-request-scope
 - cdi-events
 - cdi-interceptors
 - cdi-decorators                 // this one doesn't actually exist!!! contribution opportunity! :)

My gut says "rest" is not the topic and shouldn't be first in the directory name and probably doesn't need to be mentioned at all.  The second thought is there are very specific annotations and metric types, so each of these could be an example.  This might give you:

 - mp-metrics-basic || simple-mp-metrics      // whichever convention we think is best
 - mp-metrics-counted
 - mp-metrics-guague
 - mp-metrics-timed

We've generally had a policy to attempt to keep examples as simple and trivial as possible.  For CDI we have one example for each scope annotation.  Doing the same with the metrics annotation would allow you to focus on the nuances of that annotation. A few advantages would be:

 - search engine optimization. having the annotation in the page title will put your content first when someone searches "mp metrics guague"
 - people can send the links to each other with "this is the metric type you want for X task.  Here's the simplest example. The other types are ignorable for X"
 - people don't have to digest all of MP Metrics at once.  we typically shoot for 5 minutes of "presentation time" per example.

I vividly remember a presentation I did at JAX London where I talked about OpenEJB for the first half, then just started showing examples for the second half.  Each five minutes.  I showed what the room wanted to see.  30 minutes go by and the session is technically over and it's lunch break, but people aren't leaving.  So I'm like, "do you want to see more?" and people stay glued to their seat and keep asking for stuff.  I showed another 20-30 minutes of 5 minute examples before I basically told everyone to go eat as the conference organizer who was standing in the back of the room the entire time gave me the nod to force everyone get out of their seats.  It was the biggest room and all the food and staff were just sitting there.

Anyway, that's the power of bite-sized examples.  You can put them together like legos and make any shape presentation you want.

If you want to do a MicroProfile general introduction, you grab the "simple foo" of each topic.  If you want to do a dedicated MicroProfile Metrics talk, you pick your favorite 5 or 8 mp-metrics-* examples.

Doing it like that you can easily bang out a bunch of examples in a few days or a week. Then have the ability to walk into almost any room and give an ad-hoc MicroProfile presentation tailored to the people in front of you.


-- 
David Blevins
http://twitter.com/dblevins
http://www.tomitribe.com

> On Nov 19, 2018, at 12:24 PM, Jonathan Gallimore <jo...@gmail.com> wrote:
> 
> Great stuff! Do checkout these - they're a pretty good format to follow:
> https://github.com/apache/tomee/blob/master/examples/simple-stateless/README.md
> .
> 
> I've merged your PR, and we can continue to iterate on it. Thanks for the
> contribution, I think its great to see some MicroProfile examples. I found
> the examples really helpful when getting started with TomEE/OpenEJB myself,
> and I'm sure folks will love seeing new examples for MicroProfile!
> 
> Jon
> 
> On Mon, Nov 19, 2018 at 8:12 PM Ivan Junckes Filho <iv...@gmail.com>
> wrote:
> 
>> Done Jon, I will keep improving it.
>> 
>> On Mon, Nov 19, 2018 at 6:01 PM Jonathan Gallimore <
>> jonathan.gallimore@gmail.com> wrote:
>> 
>>> Very cool. I'd suggest adding a README like the other examples have, as
>>> that can be linked from the website, and they usually provide great
>>> documentation.
>>> 
>>> Jon
>>> 
>>> On Mon, 19 Nov 2018, 19:51 Ivan Junckes Filho <ivanjunckes@gmail.com
>>> wrote:
>>> 
>>>> Hey guys, just to let you know that I created a Microprofile Metrics
>>>> Example under Tomee.
>>>> 
>>>> I am still working on that and I will provide more test scenarios.
>>>> 
>>>> Here is the PR if you want to review the work so far:
>>>> https://github.com/apache/tomee/pull/203
>>>> 
>>>> Feel free to merge if you think this can be done incrementally.
>>>> 
>>> 
>> 


Re: Microprofile Metrics Example

Posted by Jonathan Gallimore <jo...@gmail.com>.
Great stuff! Do checkout these - they're a pretty good format to follow:
https://github.com/apache/tomee/blob/master/examples/simple-stateless/README.md
.

I've merged your PR, and we can continue to iterate on it. Thanks for the
contribution, I think its great to see some MicroProfile examples. I found
the examples really helpful when getting started with TomEE/OpenEJB myself,
and I'm sure folks will love seeing new examples for MicroProfile!

Jon

On Mon, Nov 19, 2018 at 8:12 PM Ivan Junckes Filho <iv...@gmail.com>
wrote:

> Done Jon, I will keep improving it.
>
> On Mon, Nov 19, 2018 at 6:01 PM Jonathan Gallimore <
> jonathan.gallimore@gmail.com> wrote:
>
> > Very cool. I'd suggest adding a README like the other examples have, as
> > that can be linked from the website, and they usually provide great
> > documentation.
> >
> > Jon
> >
> > On Mon, 19 Nov 2018, 19:51 Ivan Junckes Filho <ivanjunckes@gmail.com
> > wrote:
> >
> > > Hey guys, just to let you know that I created a Microprofile Metrics
> > > Example under Tomee.
> > >
> > > I am still working on that and I will provide more test scenarios.
> > >
> > > Here is the PR if you want to review the work so far:
> > > https://github.com/apache/tomee/pull/203
> > >
> > > Feel free to merge if you think this can be done incrementally.
> > >
> >
>

Re: Microprofile Metrics Example

Posted by Ivan Junckes Filho <iv...@gmail.com>.
Done Jon, I will keep improving it.

On Mon, Nov 19, 2018 at 6:01 PM Jonathan Gallimore <
jonathan.gallimore@gmail.com> wrote:

> Very cool. I'd suggest adding a README like the other examples have, as
> that can be linked from the website, and they usually provide great
> documentation.
>
> Jon
>
> On Mon, 19 Nov 2018, 19:51 Ivan Junckes Filho <ivanjunckes@gmail.com
> wrote:
>
> > Hey guys, just to let you know that I created a Microprofile Metrics
> > Example under Tomee.
> >
> > I am still working on that and I will provide more test scenarios.
> >
> > Here is the PR if you want to review the work so far:
> > https://github.com/apache/tomee/pull/203
> >
> > Feel free to merge if you think this can be done incrementally.
> >
>

Re: Microprofile Metrics Example

Posted by Jonathan Gallimore <jo...@gmail.com>.
Very cool. I'd suggest adding a README like the other examples have, as
that can be linked from the website, and they usually provide great
documentation.

Jon

On Mon, 19 Nov 2018, 19:51 Ivan Junckes Filho <ivanjunckes@gmail.com wrote:

> Hey guys, just to let you know that I created a Microprofile Metrics
> Example under Tomee.
>
> I am still working on that and I will provide more test scenarios.
>
> Here is the PR if you want to review the work so far:
> https://github.com/apache/tomee/pull/203
>
> Feel free to merge if you think this can be done incrementally.
>

Re: Microprofile Metrics Example

Posted by Ivan Junckes Filho <iv...@gmail.com>.
Any feedback on this?

On Tue, Nov 27, 2018 at 4:14 PM Ivan Junckes Filho <iv...@gmail.com>
wrote:

> Hey guys I did some improvements on this example:
>
>    - Fixing payload in test after the fix of a jsonb regression
>    - Replace Webclient with WebTarget
>    - Fix to use top level properties with versions
>    - Better assertion by key type
>
> Could you please review?
> https://github.com/apache/tomee/pull/221
>
> On Tue, Nov 20, 2018 at 8:35 PM Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
>> Well it was not a big issue bit something to take care. The pr - not yet
>> merged - is way more impacting users and kind of justifies to not use MP
>> today :(.
>>
>> Le mar. 20 nov. 2018 22:39, César Hernández Mendoza <cesarguate@gmail.com
>> >
>> a écrit :
>>
>> > Hi Romain,
>> >
>> > Did you test passing accept header or just in the browser which sends
>> json
>> > > and text as acceptable value so resolution can be not that
>> deterministic
>> > > using it - but this is the request so all fine ;).
>> >
>> >
>> > Yes, yesterday my test was performed using safari and that was causing
>> the
>> > behaviour I describe in my previous email.
>> > Today I build tested again and did some test using curl and the Accept
>> > header and I didn't find any issue. Thanks for the help.
>> >
>> > The last side note is prometheus does not support monotonic=false (small
>> > > glitch in the spec).
>> >
>> > Interesting, It seems this is been fixed for microprofile metrics 2.x
>> > release [1] [2] as we are speaking.
>> >
>> > [1] https://github.com/eclipse/microprofile-metrics/pull/309
>> > [2] https://github.com/eclipse/microprofile-metrics/issues/290
>> >
>> >
>> > El lun., 19 nov. 2018 a las 23:52, Romain Manni-Bucau (<
>> > rmannibucau@gmail.com>) escribió:
>> >
>> > > Hi César,
>> > >
>> > > Did you test passing accept header or just in the browser which sends
>> > json
>> > > and text as acceptable value so resolution can be not that
>> deterministic
>> > > using it - but this is the request so all fine ;).
>> > >
>> > > The last side note is prometheus does not support monotonic=false
>> (small
>> > > glitch in the spec).
>> > >
>> > > Le mar. 20 nov. 2018 03:12, César Hernández Mendoza <
>> > cesarguate@gmail.com>
>> > > a écrit :
>> > >
>> > > > Hi Ivan, nice job with this example.
>> > > >
>> > > > I found another potential issue with the metrics in TomEE, If you
>> > remove
>> > > > the `monotonic = true` from the @Counted annotation, then the
>> format of
>> > > the
>> > > > endpoint: http://localhost:8080/rest-mp-metrics/metrics is no
>> longer
>> > > > Prometheus but JSON instead.
>> > > >
>> > > >
>> > > > Without `monotonic = true`
>> > > >
>> > > >
>> > > >
>> > >
>> >
>> {"application":{"message_counter":0},"vendor":{"startTime":1542679115312},"base":{"classloader.totalLoadedClass.count":8971,"thread.count":39,"classloader.currentLoadedClass.count":8971,"jvm.uptime":103050,"gc.PS
>> > > >
>> > > >
>> > >
>> >
>> MarkSweep.count":2,"thread.max.count":39,"memory.committedHeap":369098752,"gc.PS
>> > > >
>> > > >
>> > >
>> >
>> Scavenge.count":7,"cpu.availableProcessors":4,"thread.daemon.count":38,"classloader.totalUnloadedClass.count":8971,"memory.maxHeap":3817865216,"memory.usedHeap":69535960,"gc.PS
>> > > > MarkSweep.time":141,"gc.PS Scavenge.time":103}}
>> > > >
>> > > >
>> > > >
>> > > > With `monotonic = true`
>> > > >
>> > > > # TYPE application:message_counter counter
>> > > > application:message_counter 0.0
>> > > > # TYPE base:classloader_total_loaded_class_count counter
>> > > > base:classloader_total_loaded_class_count 8839.0
>> > > > # TYPE base:thread_count counter
>> > > > base:thread_count 39.0
>> > > > # TYPE base:classloader_current_loaded_class_count counter
>> > > > base:classloader_current_loaded_class_count 8847.0
>> > > > # TYPE base:jvm_uptime_seconds gauge
>> > > > base:jvm_uptime_seconds 0.006427
>> > > > # TYPE base:gc_ps_mark_sweep_count counter
>> > > > base:gc_ps_mark_sweep_count 2.0
>> > > > # TYPE base:gc_ps_scavenge_count counter
>> > > > base:gc_ps_scavenge_count 7.0
>> > > > # TYPE base:memory_committed_heap_bytes gauge
>> > > > base:memory_committed_heap_bytes 3.70147328E8
>> > > > # TYPE base:thread_max_count counter
>> > > > base:thread_max_count 39.0
>> > > > # TYPE base:cpu_available_processors gauge
>> > > > base:cpu_available_processors 4.0
>> > > > # TYPE base:thread_daemon_count counter
>> > > > base:thread_daemon_count 38.0
>> > > > # TYPE base:classloader_total_unloaded_class_count counter
>> > > > base:classloader_total_unloaded_class_count 8847.0
>> > > > # TYPE base:memory_max_heap_bytes gauge
>> > > > base:memory_max_heap_bytes 3.817865216E9
>> > > > # TYPE base:gc_ps_mark_sweep_time_seconds gauge
>> > > > base:gc_ps_mark_sweep_time_seconds 1.19E-4
>> > > > # TYPE base:memory_used_heap_bytes gauge
>> > > > base:memory_used_heap_bytes 6.7481504E7
>> > > > # TYPE base:gc_ps_scavenge_time_seconds gauge
>> > > > base:gc_ps_scavenge_time_seconds 1.09E-4
>> > > > # TYPE vendor:start_time counter
>> > > > vendor:start_time 1.542679428814E12
>> > > >
>> > > >
>> > > > This is not stated on the MP metrics spec. So I wonder if TomEE
>> should
>> > > > provide a set of properties to avoid these random behaviors.
>> > > >
>> > > >
>> > > > El lun., 19 nov. 2018 a las 13:51, Ivan Junckes Filho (<
>> > > > ivanjunckes@gmail.com>) escribió:
>> > > >
>> > > > > Hey guys, just to let you know that I created a Microprofile
>> Metrics
>> > > > > Example under Tomee.
>> > > > >
>> > > > > I am still working on that and I will provide more test scenarios.
>> > > > >
>> > > > > Here is the PR if you want to review the work so far:
>> > > > > https://github.com/apache/tomee/pull/203
>> > > > >
>> > > > > Feel free to merge if you think this can be done incrementally.
>> > > > >
>> > > >
>> > > >
>> > > > --
>> > > > Atentamente:
>> > > > César Hernández Mendoza.
>> > > >
>> > >
>> >
>> >
>> > --
>> > Atentamente:
>> > César Hernández Mendoza.
>> >
>>
>

Re: Microprofile Metrics Example

Posted by Ivan Junckes Filho <iv...@gmail.com>.
Hey guys I did some improvements on this example:

   - Fixing payload in test after the fix of a jsonb regression
   - Replace Webclient with WebTarget
   - Fix to use top level properties with versions
   - Better assertion by key type

Could you please review?
https://github.com/apache/tomee/pull/221

On Tue, Nov 20, 2018 at 8:35 PM Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Well it was not a big issue bit something to take care. The pr - not yet
> merged - is way more impacting users and kind of justifies to not use MP
> today :(.
>
> Le mar. 20 nov. 2018 22:39, César Hernández Mendoza <ce...@gmail.com>
> a écrit :
>
> > Hi Romain,
> >
> > Did you test passing accept header or just in the browser which sends
> json
> > > and text as acceptable value so resolution can be not that
> deterministic
> > > using it - but this is the request so all fine ;).
> >
> >
> > Yes, yesterday my test was performed using safari and that was causing
> the
> > behaviour I describe in my previous email.
> > Today I build tested again and did some test using curl and the Accept
> > header and I didn't find any issue. Thanks for the help.
> >
> > The last side note is prometheus does not support monotonic=false (small
> > > glitch in the spec).
> >
> > Interesting, It seems this is been fixed for microprofile metrics 2.x
> > release [1] [2] as we are speaking.
> >
> > [1] https://github.com/eclipse/microprofile-metrics/pull/309
> > [2] https://github.com/eclipse/microprofile-metrics/issues/290
> >
> >
> > El lun., 19 nov. 2018 a las 23:52, Romain Manni-Bucau (<
> > rmannibucau@gmail.com>) escribió:
> >
> > > Hi César,
> > >
> > > Did you test passing accept header or just in the browser which sends
> > json
> > > and text as acceptable value so resolution can be not that
> deterministic
> > > using it - but this is the request so all fine ;).
> > >
> > > The last side note is prometheus does not support monotonic=false
> (small
> > > glitch in the spec).
> > >
> > > Le mar. 20 nov. 2018 03:12, César Hernández Mendoza <
> > cesarguate@gmail.com>
> > > a écrit :
> > >
> > > > Hi Ivan, nice job with this example.
> > > >
> > > > I found another potential issue with the metrics in TomEE, If you
> > remove
> > > > the `monotonic = true` from the @Counted annotation, then the format
> of
> > > the
> > > > endpoint: http://localhost:8080/rest-mp-metrics/metrics is no longer
> > > > Prometheus but JSON instead.
> > > >
> > > >
> > > > Without `monotonic = true`
> > > >
> > > >
> > > >
> > >
> >
> {"application":{"message_counter":0},"vendor":{"startTime":1542679115312},"base":{"classloader.totalLoadedClass.count":8971,"thread.count":39,"classloader.currentLoadedClass.count":8971,"jvm.uptime":103050,"gc.PS
> > > >
> > > >
> > >
> >
> MarkSweep.count":2,"thread.max.count":39,"memory.committedHeap":369098752,"gc.PS
> > > >
> > > >
> > >
> >
> Scavenge.count":7,"cpu.availableProcessors":4,"thread.daemon.count":38,"classloader.totalUnloadedClass.count":8971,"memory.maxHeap":3817865216,"memory.usedHeap":69535960,"gc.PS
> > > > MarkSweep.time":141,"gc.PS Scavenge.time":103}}
> > > >
> > > >
> > > >
> > > > With `monotonic = true`
> > > >
> > > > # TYPE application:message_counter counter
> > > > application:message_counter 0.0
> > > > # TYPE base:classloader_total_loaded_class_count counter
> > > > base:classloader_total_loaded_class_count 8839.0
> > > > # TYPE base:thread_count counter
> > > > base:thread_count 39.0
> > > > # TYPE base:classloader_current_loaded_class_count counter
> > > > base:classloader_current_loaded_class_count 8847.0
> > > > # TYPE base:jvm_uptime_seconds gauge
> > > > base:jvm_uptime_seconds 0.006427
> > > > # TYPE base:gc_ps_mark_sweep_count counter
> > > > base:gc_ps_mark_sweep_count 2.0
> > > > # TYPE base:gc_ps_scavenge_count counter
> > > > base:gc_ps_scavenge_count 7.0
> > > > # TYPE base:memory_committed_heap_bytes gauge
> > > > base:memory_committed_heap_bytes 3.70147328E8
> > > > # TYPE base:thread_max_count counter
> > > > base:thread_max_count 39.0
> > > > # TYPE base:cpu_available_processors gauge
> > > > base:cpu_available_processors 4.0
> > > > # TYPE base:thread_daemon_count counter
> > > > base:thread_daemon_count 38.0
> > > > # TYPE base:classloader_total_unloaded_class_count counter
> > > > base:classloader_total_unloaded_class_count 8847.0
> > > > # TYPE base:memory_max_heap_bytes gauge
> > > > base:memory_max_heap_bytes 3.817865216E9
> > > > # TYPE base:gc_ps_mark_sweep_time_seconds gauge
> > > > base:gc_ps_mark_sweep_time_seconds 1.19E-4
> > > > # TYPE base:memory_used_heap_bytes gauge
> > > > base:memory_used_heap_bytes 6.7481504E7
> > > > # TYPE base:gc_ps_scavenge_time_seconds gauge
> > > > base:gc_ps_scavenge_time_seconds 1.09E-4
> > > > # TYPE vendor:start_time counter
> > > > vendor:start_time 1.542679428814E12
> > > >
> > > >
> > > > This is not stated on the MP metrics spec. So I wonder if TomEE
> should
> > > > provide a set of properties to avoid these random behaviors.
> > > >
> > > >
> > > > El lun., 19 nov. 2018 a las 13:51, Ivan Junckes Filho (<
> > > > ivanjunckes@gmail.com>) escribió:
> > > >
> > > > > Hey guys, just to let you know that I created a Microprofile
> Metrics
> > > > > Example under Tomee.
> > > > >
> > > > > I am still working on that and I will provide more test scenarios.
> > > > >
> > > > > Here is the PR if you want to review the work so far:
> > > > > https://github.com/apache/tomee/pull/203
> > > > >
> > > > > Feel free to merge if you think this can be done incrementally.
> > > > >
> > > >
> > > >
> > > > --
> > > > Atentamente:
> > > > César Hernández Mendoza.
> > > >
> > >
> >
> >
> > --
> > Atentamente:
> > César Hernández Mendoza.
> >
>

Re: Microprofile Metrics Example

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Well it was not a big issue bit something to take care. The pr - not yet
merged - is way more impacting users and kind of justifies to not use MP
today :(.

Le mar. 20 nov. 2018 22:39, César Hernández Mendoza <ce...@gmail.com>
a écrit :

> Hi Romain,
>
> Did you test passing accept header or just in the browser which sends json
> > and text as acceptable value so resolution can be not that deterministic
> > using it - but this is the request so all fine ;).
>
>
> Yes, yesterday my test was performed using safari and that was causing the
> behaviour I describe in my previous email.
> Today I build tested again and did some test using curl and the Accept
> header and I didn't find any issue. Thanks for the help.
>
> The last side note is prometheus does not support monotonic=false (small
> > glitch in the spec).
>
> Interesting, It seems this is been fixed for microprofile metrics 2.x
> release [1] [2] as we are speaking.
>
> [1] https://github.com/eclipse/microprofile-metrics/pull/309
> [2] https://github.com/eclipse/microprofile-metrics/issues/290
>
>
> El lun., 19 nov. 2018 a las 23:52, Romain Manni-Bucau (<
> rmannibucau@gmail.com>) escribió:
>
> > Hi César,
> >
> > Did you test passing accept header or just in the browser which sends
> json
> > and text as acceptable value so resolution can be not that deterministic
> > using it - but this is the request so all fine ;).
> >
> > The last side note is prometheus does not support monotonic=false (small
> > glitch in the spec).
> >
> > Le mar. 20 nov. 2018 03:12, César Hernández Mendoza <
> cesarguate@gmail.com>
> > a écrit :
> >
> > > Hi Ivan, nice job with this example.
> > >
> > > I found another potential issue with the metrics in TomEE, If you
> remove
> > > the `monotonic = true` from the @Counted annotation, then the format of
> > the
> > > endpoint: http://localhost:8080/rest-mp-metrics/metrics is no longer
> > > Prometheus but JSON instead.
> > >
> > >
> > > Without `monotonic = true`
> > >
> > >
> > >
> >
> {"application":{"message_counter":0},"vendor":{"startTime":1542679115312},"base":{"classloader.totalLoadedClass.count":8971,"thread.count":39,"classloader.currentLoadedClass.count":8971,"jvm.uptime":103050,"gc.PS
> > >
> > >
> >
> MarkSweep.count":2,"thread.max.count":39,"memory.committedHeap":369098752,"gc.PS
> > >
> > >
> >
> Scavenge.count":7,"cpu.availableProcessors":4,"thread.daemon.count":38,"classloader.totalUnloadedClass.count":8971,"memory.maxHeap":3817865216,"memory.usedHeap":69535960,"gc.PS
> > > MarkSweep.time":141,"gc.PS Scavenge.time":103}}
> > >
> > >
> > >
> > > With `monotonic = true`
> > >
> > > # TYPE application:message_counter counter
> > > application:message_counter 0.0
> > > # TYPE base:classloader_total_loaded_class_count counter
> > > base:classloader_total_loaded_class_count 8839.0
> > > # TYPE base:thread_count counter
> > > base:thread_count 39.0
> > > # TYPE base:classloader_current_loaded_class_count counter
> > > base:classloader_current_loaded_class_count 8847.0
> > > # TYPE base:jvm_uptime_seconds gauge
> > > base:jvm_uptime_seconds 0.006427
> > > # TYPE base:gc_ps_mark_sweep_count counter
> > > base:gc_ps_mark_sweep_count 2.0
> > > # TYPE base:gc_ps_scavenge_count counter
> > > base:gc_ps_scavenge_count 7.0
> > > # TYPE base:memory_committed_heap_bytes gauge
> > > base:memory_committed_heap_bytes 3.70147328E8
> > > # TYPE base:thread_max_count counter
> > > base:thread_max_count 39.0
> > > # TYPE base:cpu_available_processors gauge
> > > base:cpu_available_processors 4.0
> > > # TYPE base:thread_daemon_count counter
> > > base:thread_daemon_count 38.0
> > > # TYPE base:classloader_total_unloaded_class_count counter
> > > base:classloader_total_unloaded_class_count 8847.0
> > > # TYPE base:memory_max_heap_bytes gauge
> > > base:memory_max_heap_bytes 3.817865216E9
> > > # TYPE base:gc_ps_mark_sweep_time_seconds gauge
> > > base:gc_ps_mark_sweep_time_seconds 1.19E-4
> > > # TYPE base:memory_used_heap_bytes gauge
> > > base:memory_used_heap_bytes 6.7481504E7
> > > # TYPE base:gc_ps_scavenge_time_seconds gauge
> > > base:gc_ps_scavenge_time_seconds 1.09E-4
> > > # TYPE vendor:start_time counter
> > > vendor:start_time 1.542679428814E12
> > >
> > >
> > > This is not stated on the MP metrics spec. So I wonder if TomEE should
> > > provide a set of properties to avoid these random behaviors.
> > >
> > >
> > > El lun., 19 nov. 2018 a las 13:51, Ivan Junckes Filho (<
> > > ivanjunckes@gmail.com>) escribió:
> > >
> > > > Hey guys, just to let you know that I created a Microprofile Metrics
> > > > Example under Tomee.
> > > >
> > > > I am still working on that and I will provide more test scenarios.
> > > >
> > > > Here is the PR if you want to review the work so far:
> > > > https://github.com/apache/tomee/pull/203
> > > >
> > > > Feel free to merge if you think this can be done incrementally.
> > > >
> > >
> > >
> > > --
> > > Atentamente:
> > > César Hernández Mendoza.
> > >
> >
>
>
> --
> Atentamente:
> César Hernández Mendoza.
>

Re: Microprofile Metrics Example

Posted by César Hernández Mendoza <ce...@gmail.com>.
Hi Romain,

Did you test passing accept header or just in the browser which sends json
> and text as acceptable value so resolution can be not that deterministic
> using it - but this is the request so all fine ;).


Yes, yesterday my test was performed using safari and that was causing the
behaviour I describe in my previous email.
Today I build tested again and did some test using curl and the Accept
header and I didn't find any issue. Thanks for the help.

The last side note is prometheus does not support monotonic=false (small
> glitch in the spec).

Interesting, It seems this is been fixed for microprofile metrics 2.x
release [1] [2] as we are speaking.

[1] https://github.com/eclipse/microprofile-metrics/pull/309
[2] https://github.com/eclipse/microprofile-metrics/issues/290


El lun., 19 nov. 2018 a las 23:52, Romain Manni-Bucau (<
rmannibucau@gmail.com>) escribió:

> Hi César,
>
> Did you test passing accept header or just in the browser which sends json
> and text as acceptable value so resolution can be not that deterministic
> using it - but this is the request so all fine ;).
>
> The last side note is prometheus does not support monotonic=false (small
> glitch in the spec).
>
> Le mar. 20 nov. 2018 03:12, César Hernández Mendoza <ce...@gmail.com>
> a écrit :
>
> > Hi Ivan, nice job with this example.
> >
> > I found another potential issue with the metrics in TomEE, If you remove
> > the `monotonic = true` from the @Counted annotation, then the format of
> the
> > endpoint: http://localhost:8080/rest-mp-metrics/metrics is no longer
> > Prometheus but JSON instead.
> >
> >
> > Without `monotonic = true`
> >
> >
> >
> {"application":{"message_counter":0},"vendor":{"startTime":1542679115312},"base":{"classloader.totalLoadedClass.count":8971,"thread.count":39,"classloader.currentLoadedClass.count":8971,"jvm.uptime":103050,"gc.PS
> >
> >
> MarkSweep.count":2,"thread.max.count":39,"memory.committedHeap":369098752,"gc.PS
> >
> >
> Scavenge.count":7,"cpu.availableProcessors":4,"thread.daemon.count":38,"classloader.totalUnloadedClass.count":8971,"memory.maxHeap":3817865216,"memory.usedHeap":69535960,"gc.PS
> > MarkSweep.time":141,"gc.PS Scavenge.time":103}}
> >
> >
> >
> > With `monotonic = true`
> >
> > # TYPE application:message_counter counter
> > application:message_counter 0.0
> > # TYPE base:classloader_total_loaded_class_count counter
> > base:classloader_total_loaded_class_count 8839.0
> > # TYPE base:thread_count counter
> > base:thread_count 39.0
> > # TYPE base:classloader_current_loaded_class_count counter
> > base:classloader_current_loaded_class_count 8847.0
> > # TYPE base:jvm_uptime_seconds gauge
> > base:jvm_uptime_seconds 0.006427
> > # TYPE base:gc_ps_mark_sweep_count counter
> > base:gc_ps_mark_sweep_count 2.0
> > # TYPE base:gc_ps_scavenge_count counter
> > base:gc_ps_scavenge_count 7.0
> > # TYPE base:memory_committed_heap_bytes gauge
> > base:memory_committed_heap_bytes 3.70147328E8
> > # TYPE base:thread_max_count counter
> > base:thread_max_count 39.0
> > # TYPE base:cpu_available_processors gauge
> > base:cpu_available_processors 4.0
> > # TYPE base:thread_daemon_count counter
> > base:thread_daemon_count 38.0
> > # TYPE base:classloader_total_unloaded_class_count counter
> > base:classloader_total_unloaded_class_count 8847.0
> > # TYPE base:memory_max_heap_bytes gauge
> > base:memory_max_heap_bytes 3.817865216E9
> > # TYPE base:gc_ps_mark_sweep_time_seconds gauge
> > base:gc_ps_mark_sweep_time_seconds 1.19E-4
> > # TYPE base:memory_used_heap_bytes gauge
> > base:memory_used_heap_bytes 6.7481504E7
> > # TYPE base:gc_ps_scavenge_time_seconds gauge
> > base:gc_ps_scavenge_time_seconds 1.09E-4
> > # TYPE vendor:start_time counter
> > vendor:start_time 1.542679428814E12
> >
> >
> > This is not stated on the MP metrics spec. So I wonder if TomEE should
> > provide a set of properties to avoid these random behaviors.
> >
> >
> > El lun., 19 nov. 2018 a las 13:51, Ivan Junckes Filho (<
> > ivanjunckes@gmail.com>) escribió:
> >
> > > Hey guys, just to let you know that I created a Microprofile Metrics
> > > Example under Tomee.
> > >
> > > I am still working on that and I will provide more test scenarios.
> > >
> > > Here is the PR if you want to review the work so far:
> > > https://github.com/apache/tomee/pull/203
> > >
> > > Feel free to merge if you think this can be done incrementally.
> > >
> >
> >
> > --
> > Atentamente:
> > César Hernández Mendoza.
> >
>


-- 
Atentamente:
César Hernández Mendoza.

Re: Microprofile Metrics Example

Posted by Ivan Junckes Filho <iv...@gmail.com>.
@Cesar / @Romain I will take a look. If there is a bug I will provide the
fix.

On Tue, Nov 20, 2018 at 3:52 AM Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Hi César,
>
> Did you test passing accept header or just in the browser which sends json
> and text as acceptable value so resolution can be not that deterministic
> using it - but this is the request so all fine ;).
>
> The last side note is prometheus does not support monotonic=false (small
> glitch in the spec).
>
> Le mar. 20 nov. 2018 03:12, César Hernández Mendoza <ce...@gmail.com>
> a écrit :
>
> > Hi Ivan, nice job with this example.
> >
> > I found another potential issue with the metrics in TomEE, If you remove
> > the `monotonic = true` from the @Counted annotation, then the format of
> the
> > endpoint: http://localhost:8080/rest-mp-metrics/metrics is no longer
> > Prometheus but JSON instead.
> >
> >
> > Without `monotonic = true`
> >
> >
> >
> {"application":{"message_counter":0},"vendor":{"startTime":1542679115312},"base":{"classloader.totalLoadedClass.count":8971,"thread.count":39,"classloader.currentLoadedClass.count":8971,"jvm.uptime":103050,"gc.PS
> >
> >
> MarkSweep.count":2,"thread.max.count":39,"memory.committedHeap":369098752,"gc.PS
> >
> >
> Scavenge.count":7,"cpu.availableProcessors":4,"thread.daemon.count":38,"classloader.totalUnloadedClass.count":8971,"memory.maxHeap":3817865216,"memory.usedHeap":69535960,"gc.PS
> > MarkSweep.time":141,"gc.PS Scavenge.time":103}}
> >
> >
> >
> > With `monotonic = true`
> >
> > # TYPE application:message_counter counter
> > application:message_counter 0.0
> > # TYPE base:classloader_total_loaded_class_count counter
> > base:classloader_total_loaded_class_count 8839.0
> > # TYPE base:thread_count counter
> > base:thread_count 39.0
> > # TYPE base:classloader_current_loaded_class_count counter
> > base:classloader_current_loaded_class_count 8847.0
> > # TYPE base:jvm_uptime_seconds gauge
> > base:jvm_uptime_seconds 0.006427
> > # TYPE base:gc_ps_mark_sweep_count counter
> > base:gc_ps_mark_sweep_count 2.0
> > # TYPE base:gc_ps_scavenge_count counter
> > base:gc_ps_scavenge_count 7.0
> > # TYPE base:memory_committed_heap_bytes gauge
> > base:memory_committed_heap_bytes 3.70147328E8
> > # TYPE base:thread_max_count counter
> > base:thread_max_count 39.0
> > # TYPE base:cpu_available_processors gauge
> > base:cpu_available_processors 4.0
> > # TYPE base:thread_daemon_count counter
> > base:thread_daemon_count 38.0
> > # TYPE base:classloader_total_unloaded_class_count counter
> > base:classloader_total_unloaded_class_count 8847.0
> > # TYPE base:memory_max_heap_bytes gauge
> > base:memory_max_heap_bytes 3.817865216E9
> > # TYPE base:gc_ps_mark_sweep_time_seconds gauge
> > base:gc_ps_mark_sweep_time_seconds 1.19E-4
> > # TYPE base:memory_used_heap_bytes gauge
> > base:memory_used_heap_bytes 6.7481504E7
> > # TYPE base:gc_ps_scavenge_time_seconds gauge
> > base:gc_ps_scavenge_time_seconds 1.09E-4
> > # TYPE vendor:start_time counter
> > vendor:start_time 1.542679428814E12
> >
> >
> > This is not stated on the MP metrics spec. So I wonder if TomEE should
> > provide a set of properties to avoid these random behaviors.
> >
> >
> > El lun., 19 nov. 2018 a las 13:51, Ivan Junckes Filho (<
> > ivanjunckes@gmail.com>) escribió:
> >
> > > Hey guys, just to let you know that I created a Microprofile Metrics
> > > Example under Tomee.
> > >
> > > I am still working on that and I will provide more test scenarios.
> > >
> > > Here is the PR if you want to review the work so far:
> > > https://github.com/apache/tomee/pull/203
> > >
> > > Feel free to merge if you think this can be done incrementally.
> > >
> >
> >
> > --
> > Atentamente:
> > César Hernández Mendoza.
> >
>

Re: Microprofile Metrics Example

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi César,

Did you test passing accept header or just in the browser which sends json
and text as acceptable value so resolution can be not that deterministic
using it - but this is the request so all fine ;).

The last side note is prometheus does not support monotonic=false (small
glitch in the spec).

Le mar. 20 nov. 2018 03:12, César Hernández Mendoza <ce...@gmail.com>
a écrit :

> Hi Ivan, nice job with this example.
>
> I found another potential issue with the metrics in TomEE, If you remove
> the `monotonic = true` from the @Counted annotation, then the format of the
> endpoint: http://localhost:8080/rest-mp-metrics/metrics is no longer
> Prometheus but JSON instead.
>
>
> Without `monotonic = true`
>
>
> {"application":{"message_counter":0},"vendor":{"startTime":1542679115312},"base":{"classloader.totalLoadedClass.count":8971,"thread.count":39,"classloader.currentLoadedClass.count":8971,"jvm.uptime":103050,"gc.PS
>
> MarkSweep.count":2,"thread.max.count":39,"memory.committedHeap":369098752,"gc.PS
>
> Scavenge.count":7,"cpu.availableProcessors":4,"thread.daemon.count":38,"classloader.totalUnloadedClass.count":8971,"memory.maxHeap":3817865216,"memory.usedHeap":69535960,"gc.PS
> MarkSweep.time":141,"gc.PS Scavenge.time":103}}
>
>
>
> With `monotonic = true`
>
> # TYPE application:message_counter counter
> application:message_counter 0.0
> # TYPE base:classloader_total_loaded_class_count counter
> base:classloader_total_loaded_class_count 8839.0
> # TYPE base:thread_count counter
> base:thread_count 39.0
> # TYPE base:classloader_current_loaded_class_count counter
> base:classloader_current_loaded_class_count 8847.0
> # TYPE base:jvm_uptime_seconds gauge
> base:jvm_uptime_seconds 0.006427
> # TYPE base:gc_ps_mark_sweep_count counter
> base:gc_ps_mark_sweep_count 2.0
> # TYPE base:gc_ps_scavenge_count counter
> base:gc_ps_scavenge_count 7.0
> # TYPE base:memory_committed_heap_bytes gauge
> base:memory_committed_heap_bytes 3.70147328E8
> # TYPE base:thread_max_count counter
> base:thread_max_count 39.0
> # TYPE base:cpu_available_processors gauge
> base:cpu_available_processors 4.0
> # TYPE base:thread_daemon_count counter
> base:thread_daemon_count 38.0
> # TYPE base:classloader_total_unloaded_class_count counter
> base:classloader_total_unloaded_class_count 8847.0
> # TYPE base:memory_max_heap_bytes gauge
> base:memory_max_heap_bytes 3.817865216E9
> # TYPE base:gc_ps_mark_sweep_time_seconds gauge
> base:gc_ps_mark_sweep_time_seconds 1.19E-4
> # TYPE base:memory_used_heap_bytes gauge
> base:memory_used_heap_bytes 6.7481504E7
> # TYPE base:gc_ps_scavenge_time_seconds gauge
> base:gc_ps_scavenge_time_seconds 1.09E-4
> # TYPE vendor:start_time counter
> vendor:start_time 1.542679428814E12
>
>
> This is not stated on the MP metrics spec. So I wonder if TomEE should
> provide a set of properties to avoid these random behaviors.
>
>
> El lun., 19 nov. 2018 a las 13:51, Ivan Junckes Filho (<
> ivanjunckes@gmail.com>) escribió:
>
> > Hey guys, just to let you know that I created a Microprofile Metrics
> > Example under Tomee.
> >
> > I am still working on that and I will provide more test scenarios.
> >
> > Here is the PR if you want to review the work so far:
> > https://github.com/apache/tomee/pull/203
> >
> > Feel free to merge if you think this can be done incrementally.
> >
>
>
> --
> Atentamente:
> César Hernández Mendoza.
>

Re: Microprofile Metrics Example

Posted by César Hernández Mendoza <ce...@gmail.com>.
Hi Ivan, nice job with this example.

I found another potential issue with the metrics in TomEE, If you remove
the `monotonic = true` from the @Counted annotation, then the format of the
endpoint: http://localhost:8080/rest-mp-metrics/metrics is no longer
Prometheus but JSON instead.


Without `monotonic = true`

{"application":{"message_counter":0},"vendor":{"startTime":1542679115312},"base":{"classloader.totalLoadedClass.count":8971,"thread.count":39,"classloader.currentLoadedClass.count":8971,"jvm.uptime":103050,"gc.PS
MarkSweep.count":2,"thread.max.count":39,"memory.committedHeap":369098752,"gc.PS
Scavenge.count":7,"cpu.availableProcessors":4,"thread.daemon.count":38,"classloader.totalUnloadedClass.count":8971,"memory.maxHeap":3817865216,"memory.usedHeap":69535960,"gc.PS
MarkSweep.time":141,"gc.PS Scavenge.time":103}}



With `monotonic = true`

# TYPE application:message_counter counter
application:message_counter 0.0
# TYPE base:classloader_total_loaded_class_count counter
base:classloader_total_loaded_class_count 8839.0
# TYPE base:thread_count counter
base:thread_count 39.0
# TYPE base:classloader_current_loaded_class_count counter
base:classloader_current_loaded_class_count 8847.0
# TYPE base:jvm_uptime_seconds gauge
base:jvm_uptime_seconds 0.006427
# TYPE base:gc_ps_mark_sweep_count counter
base:gc_ps_mark_sweep_count 2.0
# TYPE base:gc_ps_scavenge_count counter
base:gc_ps_scavenge_count 7.0
# TYPE base:memory_committed_heap_bytes gauge
base:memory_committed_heap_bytes 3.70147328E8
# TYPE base:thread_max_count counter
base:thread_max_count 39.0
# TYPE base:cpu_available_processors gauge
base:cpu_available_processors 4.0
# TYPE base:thread_daemon_count counter
base:thread_daemon_count 38.0
# TYPE base:classloader_total_unloaded_class_count counter
base:classloader_total_unloaded_class_count 8847.0
# TYPE base:memory_max_heap_bytes gauge
base:memory_max_heap_bytes 3.817865216E9
# TYPE base:gc_ps_mark_sweep_time_seconds gauge
base:gc_ps_mark_sweep_time_seconds 1.19E-4
# TYPE base:memory_used_heap_bytes gauge
base:memory_used_heap_bytes 6.7481504E7
# TYPE base:gc_ps_scavenge_time_seconds gauge
base:gc_ps_scavenge_time_seconds 1.09E-4
# TYPE vendor:start_time counter
vendor:start_time 1.542679428814E12


This is not stated on the MP metrics spec. So I wonder if TomEE should
provide a set of properties to avoid these random behaviors.


El lun., 19 nov. 2018 a las 13:51, Ivan Junckes Filho (<
ivanjunckes@gmail.com>) escribió:

> Hey guys, just to let you know that I created a Microprofile Metrics
> Example under Tomee.
>
> I am still working on that and I will provide more test scenarios.
>
> Here is the PR if you want to review the work so far:
> https://github.com/apache/tomee/pull/203
>
> Feel free to merge if you think this can be done incrementally.
>


-- 
Atentamente:
César Hernández Mendoza.