Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

API

Moderators: Vladimir Kondratyev, Anton Katilin

API

Postby arkein » Fri Apr 30, 2010 1:36 pm

Hello,

I'm trying to use YourKit .NET 4.5 / 5 API but the profiler UI needs to be launched in order to start CPU profiling (Exception "to use the profiler API, run the application with YourKit Profiler")

I'd like to know if it's possible to use the API as a standalone, separately from the yourkit profiler application ? The purpose would be to profile an application calling methods of the API just to get snapshots and process it manually.

Thank you.
arkein
 
Posts: 11
Joined: Thu Apr 29, 2010 3:07 pm

Re: API

Postby Anton Katilin » Fri Apr 30, 2010 4:19 pm

Hello,

Perhaps I do not properly understand your question, so please provide more detail if my answer is not relevant.

You can redistribute files ynpagent.dll, YourKit.Profiler.Api.dll and YourKit.Profiler.Api.xml. Please find license in <Profiler Installation Directory>\license-redist.txt

To use the API, you need YourKit.Profiler.Api.dll (see Help: http://www.yourkit.com/docs/net50/help/api.jsp )

To enable profiling without installing the profiler in full, you need the profiler agent ynpagent.dll. You should register it and enable profiling for applications you need, as described here: http://www.yourkit.com/docs/net50/help/ ... manual.jsp

Best regards,
Anton
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Postby arkein » Mon May 03, 2010 7:33 am

Hello,

Thanks for the answer.

I
- installed Yourkit Profiler 5
- registered ynpagent.dll : Regsvr32.exe <path>/ynpagent.dll
- set environment variables as described in the manual

but i still get an exception "To use the profiler API, run the application with YourKit Profiler" when i do a new Controller(); Did i miss something ?

Something else : Can snapshots be read only by yourkit profiler application or is it possible to extract information manually from it ?
arkein
 
Posts: 11
Joined: Thu Apr 29, 2010 3:07 pm

Re: API

Postby Anton Katilin » Tue May 04, 2010 10:44 am

Hello,

Do you have a 64-bit Windows?

If yes, please ensure you properly registered the DLL. For detail, please see http://www.yourkit.com/docs/net50/help/ ... remote.jsp (part "2. Register the DLL on the remote machine")

Can snapshots be read only by yourkit profiler application or is it possible to extract information manually from it ?


Please consider offline export feature.

Run the following command (assume <profiler installation directory>\bin is the current directory):

profiler.exe -export snapshot_file_path target_directory_path

Note: target directory must exist.
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Postby arkein » Tue May 04, 2010 12:27 pm

Anton Katilin wrote:Hello,
Do you have a 64-bit Windows?
If yes, please ensure you properly registered the DLL. For detail, please see http://www.yourkit.com/docs/net50/help/ ... remote.jsp (part "2. Register the DLL on the remote machine")


No, i have a 32-bit windows.

[quote="Anton Katilin"]
Please consider offline export feature.
Run the following command (assume <profiler installation directory>\bin is the current directory):
profiler.exe -export snapshot_file_path target_directory_path
Note: target directory must exist.

Thanks, works perfectly.
arkein
 
Posts: 11
Joined: Thu Apr 29, 2010 3:07 pm

Re: API

Postby Anton Katilin » Tue May 04, 2010 1:14 pm

Which GUID have you specified?

Please ensure that you use ynpagent.dll and guid.txt from exactly the same version/build.
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Postby arkein » Tue May 04, 2010 1:21 pm

It works now.
"set COR_ENABLE_PROFILING=1" strangely seems to have no effect but after modifying manually the value with regedit, it works.
Thank you a lot.
arkein
 
Posts: 11
Joined: Thu Apr 29, 2010 3:07 pm

Re: API

Postby arkein » Thu May 06, 2010 12:22 pm

Hello,

Another problem, i'm trying to profile a remote ASP.net application (set to work on Framework 2.0) but only standalone applications are detected.

There is no log corresponding to an ASP.net application in <user home directory>\.ynp\log\

The remote server runs on Windows 2003 server and IIS 6.0. Profiling works fine with standalone applications.
Do you know where the problem could come from ? I checked the documentation but couldn't find any solution.

Thank you.
arkein
 
Posts: 11
Joined: Thu Apr 29, 2010 3:07 pm

Re: API

Postby Anton Katilin » Thu May 06, 2010 12:58 pm

Hello,

Please ensure you use build 5.0.1:
http://www.yourkit.com/dotnet/download/

There were bug fixes since 5.0.0 which might affect.

Best regards,
Anton
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Postby arkein » Thu May 06, 2010 1:13 pm

Actually I posted after updating to 5.0.1, unfortunately it doesn't change anything :/
arkein
 
Posts: 11
Joined: Thu Apr 29, 2010 3:07 pm

Re: API

Postby Anton Katilin » Thu May 06, 2010 1:40 pm

Logs are created in service user's home directory.

Thus, it can be C:\WINDOWS\system32\config\systemprofile\.ynp or C:\Windows\ServiceProfiles\NetworkService\.ynp

If the location is different, please try searching for .ynp directory on local disk(s).

The remote server runs on Windows 2003 server and IIS 6.0. Profiling works fine with standalone applications.


Could you please clarify: do you connect to that remote machine via "File | Connect to Remote Application...", but it says no application is found?
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Postby arkein » Thu May 06, 2010 1:53 pm

Anton Katilin wrote:Logs are created in service user's home directory.
Thus, it can be C:\WINDOWS\system32\config\systemprofile\.ynp or C:\Windows\ServiceProfiles\NetworkService\.ynp
If the location is different, please try searching for .ynp directory on local disk(s).


- Logs for standalone applications running on the remote machine are created in C:\WINDOWS\system32\config\systemprofile\.ynp\log, yes.
- In C:\Documents and Settings\<user directory>\.ynp\log there is nearly only logs about a "DllHost.exe".
- Nothing about ASP.net applications.

Anton Katilin wrote:Could you please clarify: do you connect to that remote machine via "File | Connect to Remote Application...", but it says no application is found?

[/quote]

Yes i connect to the remote machine via "Connect to Remote Application". It search and find only standalone applications running on the remote machine.
arkein
 
Posts: 11
Joined: Thu Apr 29, 2010 3:07 pm

Re: API

Postby Anton Katilin » Thu May 06, 2010 2:29 pm

Could you please also check C:\Documents and Settings\NetworkService\.ynp
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Postby arkein » Thu May 06, 2010 2:34 pm

There is no directory ".ynp" in C:\Documents and Settings\NetworkService\
arkein
 
Posts: 11
Joined: Thu Apr 29, 2010 3:07 pm

Re: API

Postby Anton Katilin » Thu May 06, 2010 2:40 pm

That means that most likely profiler agent is not loaded.

Could you please check ynpagent.dll access rights. Does it have read and execute rights from the service user?
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Next

Return to .NET Profiler

Who is online

Users browsing this forum: No registered users and 1 guest

cron