stevensouza / jamonapi

Another repo for jamonapi.com which is primarily hosted on sourceforge
57 stars 24 forks source link

Any idea with jamon support for Jedis #6

Closed bwzhang2011 closed 2 years ago

bwzhang2011 commented 9 years ago

@stevensouza, as Jedis widely used with redis, any idea with the support for Jedis monitor, e.g we care about its operation from jedis and also with the parameters passed. just like the monitor towards jdbc connection.

stevensouza commented 9 years ago

I have another open source project that would help you do this. Here is an article about it: http://jaxenter.com/advanced-java-monitoring-with-automon-116079.html

It can be found here: www.automon.org

The basic idea is that it lets you monitor any java methods at runtime by configuring WHAT you want to monitor in an xml file. It uses jamon or any other monitoring tool to do the actual monitoring (HOW). So it separates WHAT you monitor from HOW you monitor.

Automon does not capture data/method arguments though. If this is important then maybe you could create an api is in front of Jedis that captures the arguments and passes them to JAMon?

bwzhang2011 commented 9 years ago

@stevensouza, thanks for feed back and I will follow the new project with automon brought in. after quick look at the new project of automon that I notice that it did has the relationship with jamon so it's better provide more documents to explain the difference and use cases. as the implementation of jamon for jdbc proxy, I still think that we should some similar work as jdbcproxy did to collector more data from other framework brought in like jedis which work similar like the jdbc connection.

stevensouza commented 9 years ago

Automon allows you to monitor ANY java class or method at runtime using AOP. It also allows you to use any monitoring tool that you would like to use to monitor (you aren't just limited to JAMon). If you use just jamon to monitor your code you would have to put jamon calls into your code. Automon allows you to not change your code at all and still monitor things.

However, automon does not incorporate method arguments (such as sql statements) into monitors at this point. To do this you would have to use something like the jamon jdbc proxy or something similar. Still I would try to use automon to monitor the main jedis methods as that will provide some good information as a starting point and should be easy to do without changing your code.

I don't use Jedis and have no knowledge of it, so this would be a good contribution to be done by you or your company.

bwzhang2011 commented 9 years ago

@stevensouza, thanks for feed back. nowadays, I have some task for monitoring jedis which is famous as the framework between application and redis among java world. jedis works jut like the jdbc connection and implemented the redis protocol so I think it has the similar parts. as you pointed out, I have to monitor the parameters and the method for calling with those data in monitor and detail info in bufferholder and then handle it up to monitor server.

bwzhang2011 commented 9 years ago

@stevensouza, I encountered some problem that jamon only limited to jdk proxy. if the real implementation has many interface to be implemented, it's hard to make it monitored just like jedis, it has no empty constructor for the super class.so if you have time, please give me your advice on how to monitor such kind of class.

stevensouza commented 9 years ago

Automon.org should allow you to monitor any class you want in jedis. Please try that.

bwzhang2011 commented 9 years ago

@stevensouza, please let me know if you have some example to do that. as my knowledge to jamon, I could not monitor the object with multiple interfaces and also no empty constructor class just like jedis, if you could take your spare time and please just make it in POM and read the source code.I don't know how to make the constructor bean to be monitored. some times just like you pointed out, I want to monitor the args so I have to deep it into the real class with correspond to. maybe you could provide some cglib support for jamon to let us for testing.

stevensouza commented 9 years ago

As you know most open source developers do this in their own time. Look at automon.org and read the documentation and look at the videos and try it. There are pom files that demonstrate how to use automon.org. Automon does not capture arguments at this time, but it will still be useful for you and I suggest you try it first.

If you have tried and have specific questions I will answer them, but I won't just do this for you. Your questions are too broad and vague for me to help you.

https://github.com/stevensouza/automon

bwzhang2011 commented 9 years ago

@stevensouza, I agree that Automon provides more higher definition towards monitor with deep integration with AOP and tried other framework to be the plugin. but now I will currently focused on proxy way for Jedis with cglib. for jdk proxy is not appropriate for such.