pcp
[Top] [All Lists]

Re: parfait updates: parfait-agent, a -java-agent for Parfair

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: parfait updates: parfait-agent, a -java-agent for Parfair
From: Paul Smith <psmith@xxxxxxxxxx>
Date: Wed, 23 Mar 2016 21:05:56 +1100
Cc: Marko Myllynen <myllynen@xxxxxxxxxx>, PCP <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <1025606193.33546699.1458721227413.JavaMail.zimbra@xxxxxxxxxx>
References: <1025606193.33546699.1458721227413.JavaMail.zimbra@xxxxxxxxxx>
Thanks Nathan, you're hacking away with the best of them!  I've created a fork 
of Parfait on my personal account with the few commits I had while you were 
having a beer with Ryan (I mean productively discussing PCP).

git@xxxxxxxxxx:tallpsmith/parfait.git

I forgot to fork your one and then do a pull request, but I'm sure you can pull 
the changes you need, or even just peak at the diffs and copy it over, very 
small stuff.

Also the parfait-users@xxxxxxxxxxxxxxxx is dead, google code is dead... Github 
is the primary case here (no mailing list for them though).

It would be great to upgrade the Spring version that's being used eventually 
when you've got things working (may be required for things like the 
OptionalSpringFactoryBean anyway), and I wonder if Spring Boot might be a 
better simpler method eventually, but for now I would recommend you keep going 
with what you have to work towards a 0.1 releasable candidates.  As outlined in 
that private email I sent you the other day, you'll have enough fun with the 
dynamic ClassLoader you'll need to wire up to bootstrap the agent.    I'm 
hoping that negates the need for any shading.

The AOP references you have removed are there only to automatically scan and 
instrument things that are marked with the annotations from the parfait-spring 
stuff.  Something to file away in a feature tracker for later, not needed right 
now for sure.

that's all I have time for tonight!

cheers,

Paul


> On 23 Mar 2016, at 7:20 PM, Nathan Scott <nathans@xxxxxxxxxx> wrote:
> 
> Hi guys,
> 
> This is highly experimental code, but shows off a working parfait-agent
> in less than 100 lines of code.  Don't merge please Paul, it needs alot
> more love yet.  :)
> 
> Changes committed to git://git.pcp.io/nathans/parfait.git master
> 
> Nathan Scott (8):
>      Early prototype code for a -java-agent jar building on Parfait
>      Update top level gitignore for generated Eclipse files
>      Add commented-out code to show possible Spring injection point
>      Un-comment-out Spring injection code, TallPaul says its close
>      monitoring.xml for parfait-agent: towards a working version
>      Update .gitignore file to ignore actively (vim-)edited files
>      Switch to using DynamicMonitoringView, toss prototype code
>      parfait-agent: functional enhancements, JMX metrics working too
> 
> 
> .gitignore                                                              |    
> 5 
> parfait-agent/.gitignore                                                |    
> 1 
> parfait-agent/build.sh                                                  |    
> 2 
> parfait-agent/demo/AgentDemo.java                                       |   
> 39 
> parfait-agent/demo/run.sh                                               |    
> 5 
> parfait-agent/pom.xml                                                   |  
> 125 
> parfait-agent/src/main/java/com/custardsource/parfait/ParfaitAgent.java |  
> 243 
> parfait-agent/src/main/resources/MANIFEST.MF                            |    
> 1 
> parfait-agent/src/main/resources/monitoring.xml                         | 
> 2859 +++++-----
> pom.xml                                                                 |    
> 3 
> 10 files changed, 2024 insertions(+), 1259 deletions(-)
> 
> 
> commit ee72b67a16849ea1d492a207f1da14f1f82d1a49
> Author: Nathan Scott <nathans@xxxxxxxxxx>
> Date:   Wed Mar 23 15:49:34 2016 +1100
> 
>    parfait-agent: functional enhancements, JMX metrics working too
> 
>    Deal with the absence of spring-utils schema by hand-coding the
>    list of JVM metrics into a javax.util.list object.  This is now
>    found by Spring and all the JMX metrics are auto-wired into the
>    registry.
> 
>    Remove several no-longer-used java imports - Spring IoC handles
>    all of that now.
> 
>    Use TallPauls Spring PropertyPlaceholderConfigurer tip, and now
>    the jvm.version metric is working as nature intended.  Started
>    using System properties more widely throughout as a result, and
>    several parameters are pushed into the properties file now.
> 
>    Discovered the G1 garbage collector metrics needed.  In Java 8,
>    the perm gen is completely removed (so these metrics commented
>    out for now) - we'll need to build a way to only optionally
>    instantiate some beans, depending on JVM version.  I see Aconex
>    folk have done before using an optional metric registry so that
>    might be the best way to go here too - OptionalFactoryBean from
>    http://stackoverflow.com/questions/3957430/optional-spring-bean-references
>    describes that approach.
> 
> commit 2d7899ccaa81d2097b2c9cab2fa080c299c6b7d4
> Author: Nathan Scott <nathans@xxxxxxxxxx>
> Date:   Fri Mar 18 19:11:29 2016 +1100
> 
>    Switch to using DynamicMonitoringView, toss prototype code
> 
>    This is now generating MMV files populated by Spring beans,
>    although most are missing currently.
> 
> commit 04d375de8107fa620fe1b90fbcf9053b6a5ce152
> Author: Nathan Scott <nathans@xxxxxxxxxx>
> Date:   Fri Mar 18 19:10:17 2016 +1100
> 
>    Update .gitignore file to ignore actively (vim-)edited files
> 
> commit 63defd5c4dca164a77f0426f37fc4709b92db6b1
> Author: Nathan Scott <nathans@xxxxxxxxxx>
> Date:   Fri Mar 18 13:45:16 2016 +1100
> 
>    monitoring.xml for parfait-agent: towards a working version
> 
>    Alrighty!  These changes get us to an agent that doesn't fall
>    over immediately:
>    - use the non-versioned xsi:schemaLocation since that resolves
>      (from withing the spring jars we're building with, I think)
>    - drop schema/util xmlns as thats not resolvable at all (we're
>      using it only for util:list which we don't seem to need just
>      yet - and theres other ways to achieve the same thing).
>    - drop a bunch of Aconex-specific class references
>    - comment-out the JDBC and codahale metrics references for now
> 
> commit 9998a45d437e4da0dd79611f38d4c23bd43af8df
> Author: Nathan Scott <nathans@xxxxxxxxxx>
> Date:   Wed Mar 16 17:16:31 2016 +1100
> 
>    Un-comment-out Spring injection code, TallPaul says its close
> 
>    Also convert monitoring.xml to non-dos line endings, and drop
>    some error-inducing parts of that file:
>    - <aop:aspectj-autoproxy/> ?
>    - clusterIdentifier (will need to revisit, use 42 for now)
>    - Bean 'tomcatThreadPoolMBeanRegistrar' (will need to think
>      about optional components like Tomcat later?)
> 
> commit 59bb87b7bd1a7933a7770d3e28c8339346dea2b0
> Author: Nathan Scott <nathans@xxxxxxxxxx>
> Date:   Wed Mar 16 14:34:22 2016 +1100
> 
>    Add commented-out code to show possible Spring injection point
> 
> commit fd1b1cdc639f6461b3873d3142702279439c59e2
> Author: Nathan Scott <nathans@xxxxxxxxxx>
> Date:   Wed Mar 16 14:04:19 2016 +1100
> 
>    Update top level gitignore for generated Eclipse files
> 
> commit 276348bda94ebe3fd7863125da7828545d08ceaf
> Author: Nathan Scott <nathans@xxxxxxxxxx>
> Date:   Wed Mar 16 14:03:41 2016 +1100
> 
>    Early prototype code for a -java-agent jar building on Parfait
> 
>    To build it,   cd parfait-agent && ./build.sh
>    To try it out,    cd parfait-agent/demo && ./run.sh
> 
>    Currently just has some hard-coded metrics; next steps are to
>    wire up parfait-jmx and parfait-spring via monitoring.xml (in
>    parfait-agent/src/main/resources)
> 

<Prev in Thread] Current Thread [Next in Thread>