Comments
3 comments
-
Hi,
Is it because the application you are profiling is the consumer of the webservice, and the web methods are running in a WCF service hosted in a webserver? In that case, you can profile the webservice to see these results. -
I have narrowd down that it has to do with passing complex objects as parameters to web api methods.
I have a Web API Controller with 4 methods. The first two
Post(int id) and Get(int id) get profile data.
The next two do not get profile data.
Get(MyObject inputObject)
Post(MyObject inputObject)
I start the Ants profile session using IIS original port and I have the Tools>Advanced Options>"Simplify very complex stack traces" and Avoid Profiling extremely trivial Method" unchecked.
IE gets launched to my homepage controllers.
Then I execute calls in fiddler and get 200 responses for all 4 calls with approrpiate response bodies.
I then go back to ANTS and stop the profile. In the methods view I need to uncheck the "Hide insignificant methods" checkbox as these apis are very simple.
I can see the data for api for the simple Post(int id) and Get(int id) but not the other two.
Here is the controller class.public class TestComplexInputController : ApiController { public int Post(int id) { return id; } public int Get(int id) { return id; } public int Get(MyObject inputObject) { return inputObject.number; } public int Post(MyObject inputObject) { return inputObject.number; } public class MyObject { public int number; } }
Here are the calls I make in fiddler========================================================== GET http://mytest.mysite.com/PerformanceTraining/api/TestComplexInput/234 HTTP/1.1 User-Agent: Fiddler Host: mytest.mysite.com Pragma: no-cache Content-Type: application/json ========================================================== POST http://mytest.mysite.com/PerformanceTraining/api/TestComplexInput/1234 HTTP/1.1 User-Agent: Fiddler Host: mytest.mysite.com Pragma: no-cache Content-Type: application/json Content-Length: 0 ========================================================== POST http://mytest.mysite.com/PerformanceTraining/api/TestComplexInput HTTP/1.1 User-Agent: Fiddler Host: mytest.mysite.com Pragma: no-cache Content-Type: application/json Content-Length: 15 {"number":1234} ========================================================== GET http://mytest.mysite.com/PerformanceTraining/api/TestComplexInput HTTP/1.1 User-Agent: Fiddler Host: mytest.mysite.com Pragma: no-cache Content-Type: application/json Content-Length: 15 {"number":1234}
-
Brian, I am definately profiling the correct process as I see other methods in the same file get profiling data.
Add comment
Please sign in to leave a comment.
[ResponseType(typeof(ResponseMessage))]
public IHttpActionResult Post(RequestMessage inRequest)
{
var engine = EngineFactory.GetMyEngine(inRequest);
var aResult = engine.GetRecommendations(inRequest, RequestContext);
return Ok<ResponseMessage>(recommendationResult);
}
Any ideas on what is going on?