Jprofiler Jpcotroller to start and stop recording of JDBC connections - jprofiler

I have a simple question and that is whether it is possible to control JProfiler recording of JDBC connections from command line?
for CPU views I use JPController but it seems it doesn't support jdbc connections.

This functionality is supported in jcontroller as of JProfiler 8.1.

Related

Jprofiler: how to detach jprofiler from a java process

I am evaluating Jprofiler.
In this process, i tried to attach a profiling scheme to a java process on a remote machine.
it provided a profiling port number, using which could connect to remote process and proceed.
But, once a profiling port is attached, i did not find anyway to de-associate the profiling port from the java process.
I would like to know if there is anyway to remove the profiling port from the java process without killing the java process.
Would appreciate your response.
Thank you very much.
Dev
There is no way to do that because the JVM does not provide a way to unload an agent.

How to monitor JVM without installing JDK

I want to monitor JVM performance on my production environment. I have installed only JRE, not JDK, Hence i can't use jstat, jconsole etc. to monitor the JVM performance.
Can somebody please help to understand how can i monitor JVM performance in this scenario?
Is there any way to achieve this?
(please note that i don't want to monitor it remotely through JMX or something else. i would like to install local agent in each machine which will send the metrics to server at the interval of 1 minute.)
Thanks,
KS
If you manage to get JMX up and running on your VM (from the comment), you can then use jmxterm or jmxfetch to push these JMX metrics into a metrics system (like graphite or Datadog).
If you have enough patience and time to write, you can probably have a look at JVMTI. You can write your code in C/C++ and run it along your Java Process and you can gather information about the JVM without affecting it.
Another simple and naive way is to start your VM with a javaagent written in java but JVMTI is even better than that. The most crucial difference between the javaagent and JVMTI app is derived from the loading mechanics. While the agents are loaded inside the heap, they are governed by the same JVM. Whereas the JVMTI agents are not governed by the JVM rules and are thus not affected by the JVM internals such as the GC or runtime error handling.
You can even give Java Mission Control a try if you're using JDK7 or above :)
Jolokia is a java agent you can use to expose JMX as http. Run jmx2graphite and get those metrics into Graphite. The link includes instructions on Graphite installation (10 minutes)

Automated UI testing on remote computers without installing anything remotely

Which options do we have to do automated UI testing on remote computers connected via RDP, if I don't want to install anything on the remote computer?
My only idea is to open the rdp session always in the same way and use recorded mouse and key strokes, but there are some disadvantages, e.g. I assume it's slow?
Anyways, do you know any open source or proprietary tools I can use? Best would be that I have to install nothing on the remote machine and play the record on my local machine.
Starting with UFT 11.50 (previously known as QTP) there is support for image based testing.
You can have one machine with UFT installed and replay on other machines via RDP using Insight UFT's image based automation solution.
eggPlant Functional allows you to automate the UI of any app on Windows machines using an RDP connection. It's pretty fast assuming you are connecting over a decent network, and you don't need to install anything additional on the target machine.

Remote Profiling Jprofiler

Hi i am very new to Jprofiler & Linux.
I am trying to Monitor my Apache Tomcat server installed on a linux machine from Jprofiler remote profiling which is installed on windows machine. Kindly help me in the procedure in detail.
I tried all the Help i could get from google but still stuck..any help will is appreciated. Thanks in advance.
In any case, you should extract the JProfiler tar.gz file for Linux on the remote machine. No further configuration is required on the remote side. On the local side you need a full installation of JProfiler.
There are two ways to get remote profiling to work:
A. Attach to the running Tomcat process
Execute the command line utility bin/jpenable in the JProfiler distribution on the remote machine and select the Tomcat process. The JVM will then be ready for profiling. If the profiled JVM is not listed, execute jpenable as the same user that runs the Tomcat JVM. If that does help, use alternative B.
On the local machine, create a session of type "Attach to profiled JVM (local or remote)", specify the host name of the remote machine and the profiling port that was set with jpenable.
When you start session, the JProfiler GUI will connect to the remote machine and you will see profiling data.
B. Use the integration wizard
Execute the command line uutility bin/jpintegrate in the JProfiler distribution on the remote machine and select your application server and follow the subsequent steps.
Then, proceed as in alternative A. This option is actually preferable to alternative A and unless you have to profile an already running JVM, you should take this route.

jvisualvm doesn't list certain Java processes

I want to get a heap dump (suspected memory leak) of a certain Java process. However, when I start the jvisualvm tool, I cannot see any of the running Java processes.
I have Google'd around about this and have already found a couple of articles saying that you have to run the Java processes using the same JDK that you start the jvisualvm tool with in order for it to be able to see them. However, as far as I can see, this is already the case. I'm doing everything locally (I have remote access to the machine).
A couple of things to consider:
The processes are running on a firewalled Windows 2008 server
The processes are running using renamed versions of the JDK java.exe executable
As far as I can see the processes are running using the 1.6.0_18 JDK
One of the running processes starts an RMI registry
I'm waiting on a virtualized copy of the server so I can mess around with it (this is a production server). But in the meanwhile; any ideas as to why I cannot see any of the processes in jvisualvm (or jconsole for that matter)?
Well after I did a little research, it would appear that Peter's comment was correct. Because the JVM processes were launched by another user (the NETWORK SERVICE account because they were being started by a Windows service) they didn't show up in jvisualvm.
Workaround
Since I have access to the application configuration, I have found the following workaround, which involves explicitly enabling unsecured JMX for the target JVM:
Add the following JVM parameters:
-Dcom.sun.management.jmxremote.port=3333 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
Add the remote process to jvisualvm using JMX by click File -> Add JMX Connection. You can connect to the process using port 3333. Obviously you can change the port if you want.
Link to article explaining this in a little more detail: http://download.oracle.com/javase/6/docs/technotes/guides/visualvm/jmx_connections.html
Notes
It's probably not a good idea to keep the JVM settings permanently, as they would allow anyone to connect to the JVM via JMX.
You can also add authentication to the JMX JVM parameters if you want to.
The simplest way is to execute jvisualvm as administrator (win: "run as administrator"). Which is not ideal but works. All java processes are visible then.