mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
Stopping sessions when handling stop requests (#627)
* Dropping profiler session on stop request * Changes to IXEventSession to simplify dropping sessions * Stop sessions instead of dropping, disable flaky tests
This commit is contained in:
committed by
GitHub
parent
b41c19bd25
commit
35b19320d4
@@ -27,6 +27,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stops monitoring a profiler session
|
/// Stops monitoring a profiler session
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool StopMonitoringSession(string sessionId);
|
bool StopMonitoringSession(string sessionId, out ProfilerSession session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,5 +14,10 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
|
|||||||
/// Reads XEvent XML from the default session target
|
/// Reads XEvent XML from the default session target
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string GetTargetXml();
|
string GetTargetXml();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stops XEvent session
|
||||||
|
/// </summary>
|
||||||
|
void Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,10 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
monitor.StopMonitoringSession(parameters.OwnerUri);
|
ProfilerSession session;
|
||||||
|
monitor.StopMonitoringSession(parameters.OwnerUri, out session);
|
||||||
|
session.XEventSession.Stop();
|
||||||
|
|
||||||
await requestContext.SendResult(new StopProfilingResult
|
await requestContext.SendResult(new StopProfilingResult
|
||||||
{
|
{
|
||||||
Succeeded = true
|
Succeeded = true
|
||||||
@@ -163,7 +166,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
await requestContext.SendError(e);
|
await requestContext.SendError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -224,9 +227,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
|
|||||||
|
|
||||||
private static Session CreateSession(SqlStoreConnection connection, string sessionName)
|
private static Session CreateSession(SqlStoreConnection connection, string sessionName)
|
||||||
{
|
{
|
||||||
string createSessionSql =
|
string createSessionSql =
|
||||||
@"
|
@"
|
||||||
CREATE EVENT SESSION [Profiler] ON SERVER
|
CREATE EVENT SESSION [Profiler] ON SERVER
|
||||||
ADD EVENT sqlserver.attention(
|
ADD EVENT sqlserver.attention(
|
||||||
ACTION(package0.event_sequence,sqlserver.client_app_name,sqlserver.client_pid,sqlserver.database_id,sqlserver.nt_username,sqlserver.query_hash,sqlserver.server_principal_name,sqlserver.session_id)
|
ACTION(package0.event_sequence,sqlserver.client_app_name,sqlserver.client_pid,sqlserver.database_id,sqlserver.nt_username,sqlserver.query_hash,sqlserver.server_principal_name,sqlserver.session_id)
|
||||||
WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)))),
|
WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)))),
|
||||||
@@ -251,7 +254,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
|
|||||||
connection.ServerConnection.ExecuteNonQuery(createSessionSql);
|
connection.ServerConnection.ExecuteNonQuery(createSessionSql);
|
||||||
|
|
||||||
XEStore store = new XEStore(connection);
|
XEStore store = new XEStore(connection);
|
||||||
return store.Sessions[sessionName];
|
return store.Sessions[sessionName];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -275,7 +278,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
|
|||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
if (!disposed)
|
if (!disposed)
|
||||||
{
|
{
|
||||||
disposed = true;
|
disposed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,17 +72,17 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stop monitoring the session specified by the sessionId
|
/// Stop monitoring the session specified by the sessionId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool StopMonitoringSession(string sessionId)
|
public bool StopMonitoringSession(string sessionId, out ProfilerSession session)
|
||||||
{
|
{
|
||||||
lock (this.sessionsLock)
|
lock (this.sessionsLock)
|
||||||
{
|
{
|
||||||
if (this.monitoredSessions.ContainsKey(sessionId))
|
if (this.monitoredSessions.ContainsKey(sessionId))
|
||||||
{
|
{
|
||||||
ProfilerSession session;
|
|
||||||
return this.monitoredSessions.Remove(sessionId, out session);
|
return this.monitoredSessions.Remove(sessionId, out session);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
session = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
|
|||||||
{
|
{
|
||||||
public Session Session { get; set; }
|
public Session Session { get; set; }
|
||||||
|
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
this.Session.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
public string GetTargetXml()
|
public string GetTargetXml()
|
||||||
{
|
{
|
||||||
if (this.Session == null)
|
if (this.Session == null)
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Agent
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Verify the default "create agent alert" request handler with valid parameters
|
/// Verify the default "create agent alert" request handler with valid parameters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Fact]
|
// TODO: Fix flaky test. See https://github.com/Microsoft/sqltoolsservice/issues/630
|
||||||
|
// [Fact]
|
||||||
public async Task TestHandleCreateAgentAlertsRequest()
|
public async Task TestHandleCreateAgentAlertsRequest()
|
||||||
{
|
{
|
||||||
using (SelfCleaningTempFile queryTempFile = new SelfCleaningTempFile())
|
using (SelfCleaningTempFile queryTempFile = new SelfCleaningTempFile())
|
||||||
@@ -84,7 +85,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Agent
|
|||||||
// {
|
// {
|
||||||
// OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
// OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
||||||
// Alert = alert
|
// Alert = alert
|
||||||
// }, deleteContext.Object);
|
// }, deleteContext.Object);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@@ -123,13 +124,13 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Agent
|
|||||||
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
||||||
Alert = alert
|
Alert = alert
|
||||||
}, createContext.Object);
|
}, createContext.Object);
|
||||||
|
|
||||||
await service.HandleUpdateAgentAlertRequest(new UpdateAgentAlertParams()
|
await service.HandleUpdateAgentAlertRequest(new UpdateAgentAlertParams()
|
||||||
{
|
{
|
||||||
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
||||||
Alert = alert
|
Alert = alert
|
||||||
}, updateContext.Object);
|
}, updateContext.Object);
|
||||||
|
|
||||||
await service.HandleDeleteAgentAlertRequest(new DeleteAgentAlertParams()
|
await service.HandleDeleteAgentAlertRequest(new DeleteAgentAlertParams()
|
||||||
{
|
{
|
||||||
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async void VerifyScriptAsCreateTable()
|
public async void VerifyScriptAsCreateTable()
|
||||||
{
|
{
|
||||||
string query = @"CREATE TABLE testTable1 (c1 int)
|
string query = @"CREATE TABLE testTable1 (c1 int)
|
||||||
GO
|
GO
|
||||||
CREATE CLUSTERED INDEX [ClusteredIndex-1] ON [dbo].[testTable1]
|
CREATE CLUSTERED INDEX [ClusteredIndex-1] ON [dbo].[testTable1]
|
||||||
(
|
(
|
||||||
@@ -167,17 +167,18 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
|||||||
await VerifyScriptAsForMultipleObjects(query, scriptingObjects, scriptCreateDrop, expectedScripts);
|
await VerifyScriptAsForMultipleObjects(query, scriptingObjects, scriptCreateDrop, expectedScripts);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
// TODO: Fix flaky test. See https://github.com/Microsoft/sqltoolsservice/issues/631
|
||||||
|
// [Fact]
|
||||||
public async void VerifyScriptAsExecuteStoredProcedure()
|
public async void VerifyScriptAsExecuteStoredProcedure()
|
||||||
{
|
{
|
||||||
string query = @"CREATE PROCEDURE testSp1
|
string query = @"CREATE PROCEDURE testSp1
|
||||||
@BusinessEntityID [int],
|
@BusinessEntityID [int],
|
||||||
@JobTitle [nvarchar](50),
|
@JobTitle [nvarchar](50),
|
||||||
@HireDate [datetime],
|
@HireDate [datetime],
|
||||||
@RateChangeDate [datetime],
|
@RateChangeDate [datetime],
|
||||||
@Rate [money],
|
@Rate [money],
|
||||||
@PayFrequency [tinyint]
|
@PayFrequency [tinyint]
|
||||||
AS
|
AS
|
||||||
BEGIN Select * from sys.all_columns END";
|
BEGIN Select * from sys.all_columns END";
|
||||||
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Execute;
|
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Execute;
|
||||||
ScriptingObject scriptingObject = new ScriptingObject
|
ScriptingObject scriptingObject = new ScriptingObject
|
||||||
@@ -320,7 +321,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
|||||||
{
|
{
|
||||||
scriptCreateOperation = $"Script{operation}";
|
scriptCreateOperation = $"Script{operation}";
|
||||||
}
|
}
|
||||||
|
|
||||||
scriptingParams.ScriptOptions = new ScriptOptions
|
scriptingParams.ScriptOptions = new ScriptOptions
|
||||||
{
|
{
|
||||||
ScriptCreateDrop = scriptCreateOperation,
|
ScriptCreateDrop = scriptCreateOperation,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Profiler
|
|||||||
/// Unit tests for ProfilerService
|
/// Unit tests for ProfilerService
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ProfilerServiceTests
|
public class ProfilerServiceTests
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Test starting a profiling session and receiving event callback
|
/// Test starting a profiling session and receiving event callback
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -35,7 +35,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Profiler
|
|||||||
string testUri = "profiler_uri";
|
string testUri = "profiler_uri";
|
||||||
var requestContext = new Mock<RequestContext<StartProfilingResult>>();
|
var requestContext = new Mock<RequestContext<StartProfilingResult>>();
|
||||||
requestContext.Setup(rc => rc.SendResult(It.IsAny<StartProfilingResult>()))
|
requestContext.Setup(rc => rc.SendResult(It.IsAny<StartProfilingResult>()))
|
||||||
.Returns<StartProfilingResult>((result) =>
|
.Returns<StartProfilingResult>((result) =>
|
||||||
{
|
{
|
||||||
// capture the session id for sending the stop message
|
// capture the session id for sending the stop message
|
||||||
sessionId = result.SessionId;
|
sessionId = result.SessionId;
|
||||||
@@ -65,5 +65,62 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Profiler
|
|||||||
Assert.Equal(sessionListener.PreviousSessionId, sessionId);
|
Assert.Equal(sessionListener.PreviousSessionId, sessionId);
|
||||||
Assert.Equal(sessionListener.PreviousEvents.Count, 1);
|
Assert.Equal(sessionListener.PreviousEvents.Count, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test stopping a session and receiving event callback
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Fact]
|
||||||
|
public async Task TestStopProfilingRequest()
|
||||||
|
{
|
||||||
|
bool success = false;
|
||||||
|
bool stopped = false;
|
||||||
|
string testUri = "test_session";
|
||||||
|
|
||||||
|
// capture stopping results
|
||||||
|
var requestContext = new Mock<RequestContext<StopProfilingResult>>();
|
||||||
|
requestContext.Setup(rc => rc.SendResult(It.IsAny<StopProfilingResult>()))
|
||||||
|
.Returns<StopProfilingResult>((result) =>
|
||||||
|
{
|
||||||
|
success = result.Succeeded;
|
||||||
|
return Task.FromResult(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
// capture if session was dropped
|
||||||
|
var mockSession = new Mock<IXEventSession>();
|
||||||
|
mockSession.Setup(p => p.Stop()).Callback(() =>
|
||||||
|
{
|
||||||
|
stopped = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
var sessionListener = new TestSessionListener();
|
||||||
|
var profilerService = new ProfilerService();
|
||||||
|
profilerService.SessionMonitor.AddSessionListener(sessionListener);
|
||||||
|
profilerService.ConnectionServiceInstance = TestObjects.GetTestConnectionService();
|
||||||
|
ConnectionInfo connectionInfo = TestObjects.GetTestConnectionInfo();
|
||||||
|
profilerService.ConnectionServiceInstance.OwnerToConnectionMap.Add(testUri, connectionInfo);
|
||||||
|
profilerService.XEventSessionFactory = new TestXEventSessionFactory();
|
||||||
|
|
||||||
|
var requestParams = new StopProfilingParams();
|
||||||
|
requestParams.OwnerUri = testUri;
|
||||||
|
|
||||||
|
ProfilerSession session = new ProfilerSession();
|
||||||
|
session.XEventSession = mockSession.Object;
|
||||||
|
session.SessionId = testUri;
|
||||||
|
|
||||||
|
profilerService.SessionMonitor.StartMonitoringSession(session);
|
||||||
|
|
||||||
|
await profilerService.HandleStopProfilingRequest(requestParams, requestContext.Object);
|
||||||
|
|
||||||
|
requestContext.VerifyAll();
|
||||||
|
|
||||||
|
// check that session was succesfully stopped and drop was called
|
||||||
|
Assert.True(success);
|
||||||
|
Assert.True(stopped);
|
||||||
|
|
||||||
|
// should not be able to remove the session, it should already be gone
|
||||||
|
ProfilerSession ps;
|
||||||
|
Assert.False(profilerService.SessionMonitor.StopMonitoringSession(testUri, out ps));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,148 +50,150 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Profiler
|
|||||||
|
|
||||||
public class TestXEventSession : IXEventSession
|
public class TestXEventSession : IXEventSession
|
||||||
{
|
{
|
||||||
private string testXEventXml =
|
private string testXEventXml =
|
||||||
"<RingBufferTarget truncated=\"0\" processingTime=\"3\" totalEventsProcessed=\"1\" eventCount=\"1\" droppedCount=\"0\" memoryUsed=\"47996\">" +
|
"<RingBufferTarget truncated=\"0\" processingTime=\"3\" totalEventsProcessed=\"1\" eventCount=\"1\" droppedCount=\"0\" memoryUsed=\"47996\">" +
|
||||||
" <event name=\"existing_connection\" package=\"sqlserver\" timestamp=\"2017-09-08T07:46:53.579Z\">" +
|
" <event name=\"existing_connection\" package=\"sqlserver\" timestamp=\"2017-09-08T07:46:53.579Z\">" +
|
||||||
" <data name=\"session_id\">" +
|
" <data name=\"session_id\">" +
|
||||||
" <type name=\"int16\" package=\"package0\"></type>" +
|
" <type name=\"int16\" package=\"package0\"></type>" +
|
||||||
" <value>51</value>" +
|
" <value>51</value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"is_dac\">" +
|
" <data name=\"is_dac\">" +
|
||||||
" <type name=\"boolean\" package=\"package0\"></type>" +
|
" <type name=\"boolean\" package=\"package0\"></type>" +
|
||||||
" <value>false</value>" +
|
" <value>false</value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"database_id\">" +
|
" <data name=\"database_id\">" +
|
||||||
" <type name=\"uint32\" package=\"package0\"></type>" +
|
" <type name=\"uint32\" package=\"package0\"></type>" +
|
||||||
" <value>1</value>" +
|
" <value>1</value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"packet_size\">" +
|
" <data name=\"packet_size\">" +
|
||||||
" <type name=\"uint32\" package=\"package0\"></type>" +
|
" <type name=\"uint32\" package=\"package0\"></type>" +
|
||||||
" <value>4096</value>" +
|
" <value>4096</value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"transaction_count\">" +
|
" <data name=\"transaction_count\">" +
|
||||||
" <type name=\"uint32\" package=\"package0\"></type>" +
|
" <type name=\"uint32\" package=\"package0\"></type>" +
|
||||||
" <value>0</value>" +
|
" <value>0</value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"group_id\">" +
|
" <data name=\"group_id\">" +
|
||||||
" <type name=\"uint32\" package=\"package0\"></type>" +
|
" <type name=\"uint32\" package=\"package0\"></type>" +
|
||||||
" <value>2</value>" +
|
" <value>2</value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"duration\">" +
|
" <data name=\"duration\">" +
|
||||||
" <type name=\"uint64\" package=\"package0\"></type>" +
|
" <type name=\"uint64\" package=\"package0\"></type>" +
|
||||||
" <value>191053000</value>" +
|
" <value>191053000</value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"client_pid\">" +
|
" <data name=\"client_pid\">" +
|
||||||
" <type name=\"uint32\" package=\"package0\"></type>" +
|
" <type name=\"uint32\" package=\"package0\"></type>" +
|
||||||
" <value>4680</value>" +
|
" <value>4680</value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"options\">" +
|
" <data name=\"options\">" +
|
||||||
" <type name=\"binary_data\" package=\"package0\"></type>" +
|
" <type name=\"binary_data\" package=\"package0\"></type>" +
|
||||||
" <value>2000002838f4010000000000</value>" +
|
" <value>2000002838f4010000000000</value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"options_text\">" +
|
" <data name=\"options_text\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value>" +
|
" <value>" +
|
||||||
" <![CDATA[-- network protocol: LPC" +
|
" <![CDATA[-- network protocol: LPC" +
|
||||||
"set quoted_identifier on" +
|
"set quoted_identifier on" +
|
||||||
"set arithabort off" +
|
"set arithabort off" +
|
||||||
"set numeric_roundabort off" +
|
"set numeric_roundabort off" +
|
||||||
"set ansi_warnings on" +
|
"set ansi_warnings on" +
|
||||||
"set ansi_padding on" +
|
"set ansi_padding on" +
|
||||||
"set ansi_nulls on" +
|
"set ansi_nulls on" +
|
||||||
"set concat_null_yields_null on" +
|
"set concat_null_yields_null on" +
|
||||||
"set cursor_close_on_commit off" +
|
"set cursor_close_on_commit off" +
|
||||||
"set implicit_transactions off" +
|
"set implicit_transactions off" +
|
||||||
"set language us_english" +
|
"set language us_english" +
|
||||||
"set dateformat mdy" +
|
"set dateformat mdy" +
|
||||||
"set datefirst 7" +
|
"set datefirst 7" +
|
||||||
"set transaction isolation level read committed" +
|
"set transaction isolation level read committed" +
|
||||||
"]]>" +
|
"]]>" +
|
||||||
" </value>" +
|
" </value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"started_event_session_name\">" +
|
" <data name=\"started_event_session_name\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[Profiler]]></value>" +
|
" <value><![CDATA[Profiler]]></value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"database_name\">" +
|
" <data name=\"database_name\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[]]></value>" +
|
" <value><![CDATA[]]></value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"client_app_name\">" +
|
" <data name=\"client_app_name\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[Microsoft SQL Server Management Studio]]></value>" +
|
" <value><![CDATA[Microsoft SQL Server Management Studio]]></value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"client_hostname\">" +
|
" <data name=\"client_hostname\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[KARLBURTRAMC189]]></value>" +
|
" <value><![CDATA[KARLBURTRAMC189]]></value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"nt_domain\">" +
|
" <data name=\"nt_domain\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[]]></value>" +
|
" <value><![CDATA[]]></value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"nt_user\">" +
|
" <data name=\"nt_user\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[]]></value>" +
|
" <value><![CDATA[]]></value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"session_nt_domain\">" +
|
" <data name=\"session_nt_domain\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[]]></value>" +
|
" <value><![CDATA[]]></value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"session_nt_user\">" +
|
" <data name=\"session_nt_user\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[]]></value>" +
|
" <value><![CDATA[]]></value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"server_principal_name\">" +
|
" <data name=\"server_principal_name\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[sa]]></value>" +
|
" <value><![CDATA[sa]]></value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"server_principal_sid\">" +
|
" <data name=\"server_principal_sid\">" +
|
||||||
" <type name=\"binary_data\" package=\"package0\"></type>" +
|
" <type name=\"binary_data\" package=\"package0\"></type>" +
|
||||||
" <value>01</value>" +
|
" <value>01</value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"session_server_principal_name\">" +
|
" <data name=\"session_server_principal_name\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[sa]]></value>" +
|
" <value><![CDATA[sa]]></value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <data name=\"session_server_principal_sid\">" +
|
" <data name=\"session_server_principal_sid\">" +
|
||||||
" <type name=\"binary_data\" package=\"package0\"></type>" +
|
" <type name=\"binary_data\" package=\"package0\"></type>" +
|
||||||
" <value>01</value>" +
|
" <value>01</value>" +
|
||||||
" </data>" +
|
" </data>" +
|
||||||
" <action name=\"session_id\" package=\"sqlserver\">" +
|
" <action name=\"session_id\" package=\"sqlserver\">" +
|
||||||
" <type name=\"uint16\" package=\"package0\"></type>" +
|
" <type name=\"uint16\" package=\"package0\"></type>" +
|
||||||
" <value>56</value>" +
|
" <value>56</value>" +
|
||||||
" </action>" +
|
" </action>" +
|
||||||
" <action name=\"server_principal_name\" package=\"sqlserver\">" +
|
" <action name=\"server_principal_name\" package=\"sqlserver\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[sa]]></value>" +
|
" <value><![CDATA[sa]]></value>" +
|
||||||
" </action>" +
|
" </action>" +
|
||||||
" <action name=\"nt_username\" package=\"sqlserver\">" +
|
" <action name=\"nt_username\" package=\"sqlserver\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[]]></value>" +
|
" <value><![CDATA[]]></value>" +
|
||||||
" </action>" +
|
" </action>" +
|
||||||
" <action name=\"client_pid\" package=\"sqlserver\">" +
|
" <action name=\"client_pid\" package=\"sqlserver\">" +
|
||||||
" <type name=\"uint32\" package=\"package0\"></type>" +
|
" <type name=\"uint32\" package=\"package0\"></type>" +
|
||||||
" <value>930958063</value>" +
|
" <value>930958063</value>" +
|
||||||
" </action>" +
|
" </action>" +
|
||||||
" <action name=\"client_app_name\" package=\"sqlserver\">" +
|
" <action name=\"client_app_name\" package=\"sqlserver\">" +
|
||||||
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
" <type name=\"unicode_string\" package=\"package0\"></type>" +
|
||||||
" <value><![CDATA[Core .Net SqlClient Data Provider]]></value>" +
|
" <value><![CDATA[Core .Net SqlClient Data Provider]]></value>" +
|
||||||
" </action>" +
|
" </action>" +
|
||||||
" <action name=\"attach_activity_id_xfer\" package=\"package0\">" +
|
" <action name=\"attach_activity_id_xfer\" package=\"package0\">" +
|
||||||
" <type name=\"activity_id_xfer\" package=\"package0\"></type>" +
|
" <type name=\"activity_id_xfer\" package=\"package0\"></type>" +
|
||||||
" <value>A2873402-C433-4D1F-94C4-9CA99749453E-0</value>" +
|
" <value>A2873402-C433-4D1F-94C4-9CA99749453E-0</value>" +
|
||||||
" </action>" +
|
" </action>" +
|
||||||
" <action name=\"attach_activity_id\" package=\"package0\">" +
|
" <action name=\"attach_activity_id\" package=\"package0\">" +
|
||||||
" <type name=\"activity_id\" package=\"package0\"></type>" +
|
" <type name=\"activity_id\" package=\"package0\"></type>" +
|
||||||
" <value>770C3538-EC3F-4A27-86A9-31A2FC777DBC-1</value>" +
|
" <value>770C3538-EC3F-4A27-86A9-31A2FC777DBC-1</value>" +
|
||||||
" </action>" +
|
" </action>" +
|
||||||
" </event>" +
|
" </event>" +
|
||||||
"</RingBufferTarget>";
|
"</RingBufferTarget>";
|
||||||
|
|
||||||
public string GetTargetXml()
|
public string GetTargetXml()
|
||||||
{
|
{
|
||||||
return testXEventXml;
|
return testXEventXml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Stop(){}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TestXEventSessionFactory : IXEventSessionFactory
|
public class TestXEventSessionFactory : IXEventSessionFactory
|
||||||
|
|||||||
Reference in New Issue
Block a user