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

Re: API

Postby arkein » Fri May 07, 2010 7:22 am

The service user ?
Sorry I'm not sure to understand. ynpagent.dll have read and execute rights for Administrators, System and the account is used to log in. I tried to grant access to IIS_WPG group but it doesn't change.

But why does it work for standalone applications if it's not loaded ?
arkein
 
Posts: 11
Joined: Thu Apr 29, 2010 3:07 pm

Re: API

Postby Anton Katilin » Fri May 07, 2010 12:48 pm

The service user ?
Sorry I'm not sure to understand. ynpagent.dll have read and execute rights for Administrators, System and the account is used to log in.


Please open Windows Task Manager and find IIS 6 process (w3wp.exe). The user which I mean should be shown in "User Name" column. If the column is not visible, please enable it via "View | Select Columns..."

I tried to grant access to IIS_WPG group but it doesn't change.


The simplest thing to do is to set ynpagent.dll's permissions "read" and "execute" to "Everyone": in ynpagent.dll's properties add user "Everyone" and check appropriate checkboxes. This will help to find out whether it's a problem with ynpagent.dll access rights or not.
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Postby arkein » Fri May 07, 2010 1:10 pm

Anton Katilin wrote:Please open Windows Task Manager and find IIS 6 process (w3wp.exe). The user which I mean should be shown in "User Name" column. If the column is not visible, please enable it via "View | Select Columns..."


There is no w3wp.exe in the task manager view (but there's inetinfo and aspnet_wp).

Anton Katilin wrote:The simplest thing to do is to set ynpagent.dll's permissions "read" and "execute" to "Everyone": in ynpagent.dll's properties add user "Everyone" and check appropriate checkboxes. This will help to find out whether it's a problem with ynpagent.dll access rights or not.


I set ynpagent's permissions to "Everyone" but it doesn't change.

I really don't understand, but i'm not the one who configured the remote machine (it's a test machine in an enterprise)
arkein
 
Posts: 11
Joined: Thu Apr 29, 2010 3:07 pm

Re: API

Postby Anton Katilin » Fri May 07, 2010 4:25 pm

Have you accessed an ASP.NET page of the profiled site (not a static content) in browser?
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Postby arkein » Sat May 08, 2010 10:45 am

Yes i did, but it still doesn't find it.
arkein
 
Posts: 11
Joined: Thu Apr 29, 2010 3:07 pm

Re: API

Postby jarbas » Fri Apr 13, 2012 1:32 pm

Hello everyone,

I'm trying to attach another application using API, but I didn´t have sucess.

Seeing the code:

Controller controller = new Controller(@"ApplicationPath", 10002);

The error code is like this:

System.Net.Sockets.SocketExpetion

The Name requested is valid. But it was not found data of requested type.

I had already registered ynpagent.dll and seted environment variables.

Someone knows where are the problem here?

Thank You!
jarbas
 
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

Re: API

Postby Anton Katilin » Fri Apr 13, 2012 3:56 pm

What is the "ApplicationPath" ?
This parameter should be the host name or IP address of the machine where the profiled application is running.
In particular, if the profiled application is running on the same machine as where you use the controller, pass "localhost" as the parameter value.
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Postby jarbas » Fri Apr 13, 2012 4:46 pm

Hello Anton,

I am running in the same machine, but if I put "localhost", the API will attach the application where I'm running the Controller class. I want to profile another application in the same machine.

Then "ApplicationPath" is the path of application where I want to atach, like "C:\Windows\System32\calc.exe".

Another example, my Controller class is running into application "X", through of my application "X" I want to attach "Y" application, see an example:

Into application "X" classes:

Controller c = new Controller("path of Y", 10001);

Do you understand? I dont know if it is possible.

Thank You.
jarbas
 
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

Re: API

Postby Anton Katilin » Fri Apr 13, 2012 5:54 pm

You should specify appropriate profiler agent port (2nd parameter) of that application to which you want to connect.

You can either specify the port explicitly via startup option "port":
http://www.yourkit.com/docs/net60/help/ ... ptions.jsp

...or learn it by analyzing that application's log file <user home>\.ynp\log\<PID>.log

The first approach is simpler and is more reliable.
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Postby jarbas » Fri Apr 13, 2012 6:21 pm

Ocurred the following IOException

Invalid header magic number:597123274982308399

I used the port where application is running:

Controller controller = new Controller(@"localhost", 1180);

:(
jarbas
 
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

Re: API

Postby Anton Katilin » Fri Apr 13, 2012 8:31 pm

Is 1180 the port which you have specified via "port" option, i.e. does the startup options applied to the application which you want to profile contain text "port=1180"?

Please re-read my previous post. The controller needs the profiler agent's port. Not the port your application uses for other purposes.
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Postby ibirite » Mon Apr 16, 2012 1:44 pm

Mr. Anton, I'm facing the very same problems that Jabras have.

I would like to ask you a question about it, if you dont mind.

1 - I need to profile a .net application using the YourkitApi. This .net app doesnt have any reference to Yourkit API assembly. To me, seems be an obvoius question:if I'm a registered user and have yourkit installed in my computer,I should be able to perform this task. Is it possible or the target application needs to recefence the YourKit API assembly?

I do belive that I'm doing something wrong here, and I need your help in order to fix it.


Kind Regards
Christiano Coutinho
ibirite
 
Posts: 2
Joined: Mon Apr 16, 2012 1:37 pm

Re: API

Postby Anton Katilin » Mon Apr 16, 2012 4:39 pm

Hello Christiano

There are 2 application we are talking about:
1) the profiled application
2) the application which uses the controller to connect to the application #1

They can be the same application (the application profiles itself) or different applications (application #2 controls application #1).

Application #1 does not need to reference the API. It should start with the profiler instead:
http://www.yourkit.com/docs/net60/help/ ... _local.jsp
http://www.yourkit.com/docs/net60/help/ ... manual.jsp

Application #2 must reference YourKit.Profiler.Api.dll whose classes it uses.

If #1 and #2 are the same application, the combination of the requirements applies.

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

Re: API

Postby ibirite » Mon Apr 16, 2012 5:28 pm

Thank you for the answer.

I'll try a few more things here in order to find what I'm doing wrong.

Kind Regards
Christiano Coutinho
ibirite
 
Posts: 2
Joined: Mon Apr 16, 2012 1:37 pm

Re: API

Postby jarbas » Mon Apr 16, 2012 8:20 pm

Anton,

When I call the GetSnapshot method, the application stop in this method e doesn´t return nothing. Then I stop by Visual Studio.

In the log, recorded this:

.NET\jre\bin\javaw.exe
[YourKit Profiler 6.0.1 for .NET] [0.001]: Reading startup options
[YourKit Profiler 6.0.1 for .NET] [0.001]: Environment variable YNP_STARTUP_OPTIONS: not defined
[YourKit Profiler 6.0.1 for .NET] [0.001]: File C:\Users\jarbas.carvalho\.ynp\config\startup-options.ini: disablealloc,port=10002
[YourKit Profiler 6.0.1 for .NET] [0.033]: error at ProfilerCore.cpp:302: Cannot start: cannot bind to port

What the value who have I to register to environment variable YNP_STARTUP_OPTIONS?

Thanks.
jarbas
 
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

PreviousNext

Return to .NET Profiler

Who is online

Users browsing this forum: No registered users and 2 guests