I already opened a question about that , but since I got a wrong answer ( I think , or i did something wrong ..) , and , since it is very important for me :
May I have a full example showing how to create diagnostic profile programmatically ?
I tried many ways to do that , but nothing works !
Among the things i did was ( for example ) , something like this :
// setting the bean ..
.... and so on ..
Are you attempting to get latency and throughput data?
There are 2 things that I want to do :
1. Getting the latency and throughput data: I'm doing that by folowing the example written in the manual ,under the title:
" Programming with JMX " and " Dynamically Monitoring the Throughput and Latency of a Component " ...
2. Getting the EPN via the DataAggregationMBean object:
My problem is that with the first ( latency and throughput ) , all works fine , but , when i disconnect from the server ,
and than reconnect , the numbers I got the first time , reduced ( i.e if in the first time I got 300, the next time I connected ' I got ~220 , and the next time ~120 , and so on ) . If i restart the cep server , than again the fisrt time is ok , than the same routine. I'm using the " terminate" method like it's recommended , but it seems
that the MBean server didn't realy unregister the probes, so it looks like it ( the server ) " remembers" the previuos probes ,
This is only my assumption, but it's the only reasonable thing i can think about.
I notice that in the visualizer , when the user builds a profile, it all works fine. That's why i wan to use DiagnosticProfile ..
2.As in the visualizer ' i want to have the EPN , or at least the order of the stages in the EPN.
I saw that the 'DataAggregationMBean ' can have it' but i don't know how to get this object..
Again, it is very important for me , because my whole project depends on it.
+"My problem is that with the first ( latency and throughput ) , all works fine , but , when i disconnect from the server ,+
+and than reconnect , the numbers I got the first time , reduced ( i.e if in the first time I got 300, the next time I connected ' I got ~220 , and the next time ~120 , and so on ) . If i restart the cep server , than again the fisrt time is ok , than the same routine. I'm using the " terminate" method like it's recommended , but it seems+
+that the MBean server didn't realy unregister the probes, so it looks like it ( the server ) " remembers" the previuos probes ,+
+This is only my assumption, but it's the only reasonable thing i can think about."+
I apologize if you already posted it once, but could you please post the code that gets the latency/throughput numbers and terminates?
One thing to note that the latency will be a little higher right at the start until it stabilizes to a lower value. It is possible that you are seeing that effect.
listener = new AverageThroughputJMXNotificationListener(stageName,connection );
When i done i use:
ofcource , i just cut the relevant parts , but I'm sure that what I'm doing is right.
My question is not about the latency but about AvgThroughput which shows wrong numbers each time i reconnect to thr server .
The numbers get smaller each time i reconnect ( I described it in my previuos post ).
My questions are very simple :
*1. How to add a profile via api ? ( DiagnosticProfile )*
*2.How to get DataAggregationMBean ?*
*3. How to get DataServiceFactoryMBean 'and then use it to add profile?*
PLEASE , I JUST WANT A GOOD EXAMPLE OF DOING THOSE THINGS !!!
If there is no answer to those, just tell me , because it's been to much time trying to figure it out.
Having my code , and asking why do I need this , does not contribute to my quetions .. I'm sure you ( the oracle company team ) wants to help , but the mosy helpfull help is via GOOD examples.
Your usage of monitoring API seems correct. The only thing I would recommend is calling probe.stop() as well before probe.terminate(). Please see if that helps. If not, can we get a simplified version of your app so that we can reproduce the issue here and fix it?
Do you see the reduction in throughput numbers immediately or is it after a few hours or so? If it is after some time, the problem could be something else on our side, hence the question.
DiagnosticProfile, DataAggregation and DataService are not meant to be public API. It looks like we included DiagnosticProfile in the public docs by mistake. Is there something in DiagnosticProfile that you cannot do by directly using the monitoring API?
Thanks for your answer.
I will try what you suggested : adding stop before terminat.
Simpilfy my code is not very easy, but i will do that.( it is also good for me to check if this phenomena happens with only one probe - now I have some ..)
The numbers of throughput get smaller every time I reconnect to the cep server - immediately . Each time i reconnect I get smaller numbers that the previous session.
I will tell you if adding stop , helped , if not I'll send you a simple code so you can check it out .
Thanks again for your answer.