Profiler notifications (#640)

* Initial changes for adding lost event notifications

* Handling polling errors by notifying listeners

* Restructuring lost events & testing

* Minor fixes to tests

* Add back in filtering

* Changing how lost events are found

* Cleaning up tests
This commit is contained in:
Madeline MacDonald
2018-06-18 17:43:22 -07:00
committed by GitHub
parent f244d307e2
commit 838a7e4fab
9 changed files with 271 additions and 17 deletions

View File

@@ -268,7 +268,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
/// <summary>
/// Callback when profiler events are available
/// </summary>
public void EventsAvailable(string sessionId, List<ProfilerEvent> events)
public void EventsAvailable(string sessionId, List<ProfilerEvent> events, bool eventsLost)
{
// pass the profiler events on to the client
this.ServiceHost.SendEvent(
@@ -276,7 +276,23 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
new ProfilerEventsAvailableParams()
{
OwnerUri = sessionId,
Events = events
Events = events,
EventsLost = eventsLost
});
}
/// <summary>
/// Callback when the XEvent session is closed unexpectedly
/// </summary>
public void SessionStopped(string viewerId, int sessionId)
{
// notify the client that their session closed
this.ServiceHost.SendEvent(
ProfilerSessionStoppedNotification.Type,
new ProfilerSessionStoppedParams()
{
OwnerUri = viewerId,
SessionId = sessionId
});
}