I have a Web API web method which returns a list of Events in xml:
public IList<Event> GetAllEvents()
{
...
}
public class Event
{
public string Name { get; set; }
public int Id { get; set; }
}
The client may send a GET request and receive 100 events which will be serialized so what happens is that:
- Request is received by GetAllEvents methods
- Data is provided by the method
- Web API engine serializes the object to xml
- Web API engine sends the serialized data (it might be e.g. 5MB) to the client
The whole process may take e.g. 5 seconds.
I'd like to be able to log the time when Web API engine finishes sending the serialized data to the client.
How to achieve this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…