jamon monitoring key

2011-05-26
2013-05-20
1 2 > >> (Page 1 of 2)
  • Romain Manni-Bucau

    Hi,

    the mon proxy factory doesn't allow to choose the key use by jamon, could it be, enhanced? It could be very nice for user of this api to choose their own key.

    - Romain

     
  • Jean-Louis MONTEIRO

    +1 using Jamon Proxy with WebSphere is a nightmare because labels are too long. It'd be great to add a label parameter to the proxy factory.

    Jean-Louis

     
  • Steve Souza

    Steve Souza - 2011-05-26

    Sorry I didn't realize you were using interface monitoring.  You are right that code is hidden.  What do you want your new MonKey to do (monkey is one of the more fun class names I have come up with!).

     
  • Romain Manni-Bucau

    Yep, we would like to be able to set ourself the MonKey or the label (as a String) to use for a MonProxy.

    The best could be: MonProxyFactory.monitor("my label", object);

    Another solution could be to create a getLabel() method with a protected visibility in MonProxy class.

     
  • Steve Souza

    Steve Souza - 2011-07-15

    <<The best could be: MonProxyFactory.monitor("my label", object);>>
    Could you elaborate on this a little more.  I am currently making code changes for a new release of JAMon and want to understand this request better.  Are you still interested in this feature? 

    For example "my label" doesn't make much sense in this context as each method that is invoked in the interface has a different label.  How would "my label" be used?

    <<+1 using Jamon Proxy with WebSphere is a nightmare because labels are too long. It'd be great to add a label parameter to the proxy factory.>>
    Can you paste a couple examples of what the websphere monitors look like?

     
  • Romain Manni-Bucau

    hi,

    yes i'm still interested in this feature.

    what is expected is simply to control the label generated.

    the best could probably be to allow a kind of labelfactory which could be specified by the user. it could have one method getlabel(object instance, string methodname) or something like that.

    - Romain

     
  • Steve Souza

    Steve Souza - 2011-07-18

    I'm still trying to get a sense of what you want, and the best way to go about it.  Can you be more explicit?  I would like some actual examples of what your current problematic labels are and what you would like them to be.

     
  • Romain Manni-Bucau

    Ok, the main problem is for exception and parameters which are fully qualified:

    ex:

    MonProxy-Interface (class=org.jamonapi.test.label.MyPojo_1234567a): public abstract java.util.Collection org.jamonapi.test.label.MyManager.getSomething(org.jamonapi.test.label.Input1,org.jamonapi.test.label.Input2,org.jamonapi.test.label.Input3,int,int) throws org.jamonapi.test.label.MyException, ms.
    

    A better label could be:

    MonProxy-Interface (class=MyPojo): public abstract Collection MyManager.getSomething(Input1,Input2,Input3,int,int) throws MyException, ms.
    

    or something with a convention, for example one letter for each package which are not in java.*:

    MonProxy-Interface (class=o.j.t.l.MyPojo_1234567a): public abstractCollection o.j.t.l.MyManager.getSomething(o.j.t.l.Input1,o.j.t.l.Input2,o.j.t.l.Input3,int,int) throws o.j.t.l.MyException, ms.
    

    I still think the best way is to allow the user to put its own factory.

    Now imagine a more complicated case: you monitor an object which is in fact a proxy of proxy (with jpa or ejbs for example), you will have a very long string or a meaningless string…or even an exception in some bad cases.

    - Romain

     
  • Steve Souza

    Steve Souza - 2011-07-18

    ok, thanks.  That helps.  I will look into adding such a capability in the next release.  This release should be in the next couple weeks.

     
  • Steve Souza

    Steve Souza - 2011-07-18

    For that matter if you want to code a label factory the way you would want it to work we could either use that or use it as a starting point.

     
  • Romain Manni-Bucau

    in MonProxy.invoke(Object proxy, Method method, Object args)  throws Throwable

    instead of

    if (params.isInterfaceEnabled && params.isEnabled)
                        mon = MonitorFactory.start(new StringBuffer().append(
                                "MonProxy-Interface ").append(className).append(
                                ": ").append(method.toString()).toString());
    ...
    

    it could be

    if (params.isInterfaceEnabled && params.isEnabled)
                        mon = MonitorFactory.start(getLabel(className, method));
    ...
    

    with:

    protected String getLabel(Stirng className, Method method) {
       if (labelfactory != null) {
          return labelfactory.getLabel(className, method); // maybe method should be decomposed into methodname, args types, exceptions to avoid the getlabel method to invoke to method. It is opened to you
       }
       return new StringBuilder().append(
                                "MonProxy-Interface ").append(className).append(
                                ": ").append(method.toString()).toString();
    }
    

    As you imagine the LabelFactory interface will only have a unique getLabel method.

    Then it only needs to be initialized from the main interface (MonProxyFactory.monitor(Object o, Class<?> interfaces, LabelFactory labelFactory)

     
  • Steve Souza

    Steve Souza - 2011-07-18

    Ok, I will put this in next release.

     
  • Steve Souza

    Steve Souza - 2011-07-18

    ok, it is appearing more complicated than I first expected.   Are you trying to add the label to the jdbc monitoring or to non-jdbc interfaces?

     
  • Romain Manni-Bucau

    immediatly on the non jdbc interfaces but the jdbc interfaces have the same behavior i think so it could be cool to have the same behavior.

    - Romain

     
  • Steve Souza

    Steve Souza - 2011-07-18

    Do you explicitly call something like the following?

    MonitorFactory.monitor(yourObject);

     
  • Romain Manni-Bucau

    yes

     
  • Steve Souza

    Steve Souza - 2011-07-19

    Ok, I just finished coding it.  I may give you a prerelease version when I have finished with the other changes.

     
  • Romain Manni-Bucau

    Ok, thank you very much

     
  • Steve Souza

    Steve Souza - 2011-07-19

    ok, There will be mulitple ways you can do this:

    - You can call MonitorFactory.setLabelFactory(factory).  This will use the same label factory for all monitored objects.

    - Alternatively if you don't want to use the same factory for all monitored objects you can change the label factory for a single monitored object. 

    - A special case is jdbc.  In this case you get monitored Statements/PreparedStatements/CallableStatements from a Connection.  These will use whatever factory the Connection object uses. 

     
  • Romain Manni-Bucau

    Perfect :)

    i'm waiting the release impatiently

     
  • Steve Souza

    Steve Souza - 2011-07-19

    I'm aiming to have a green prerelease by the end of the week. 

     
  • Steve Souza

    Steve Souza - 2011-07-19

    Also, out of curiosity what types of things/interfaces are you using jamon to monitor?

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks