XEvent Profiler initial event handlers (#456)

* Bump SMO to 140.2.5 to pick-up private XEvent binaries

* Pick up SMO binaries from the build lab

* Add ProfilerService class placeholder

* Update SMO nuget package to include DB Scoped XEvents

* Stage changes

* Stage changes

* Update SMO to use RTM dependencies and remove separate SqlScript package

* Stage changes

* Iterate on profiler service

* Fix post-merge break in localization

* More refactoring

* Continue iterating on profiler

* Add test profiler listener

* Address a couple of the code review feedback

* Fix AppVeyor build break

* Use self-cleaning test file
This commit is contained in:
Karl Burtram
2017-09-12 14:08:50 -07:00
committed by GitHub
parent 2677efb6b8
commit 84ea045572
42 changed files with 1448 additions and 115 deletions

View File

@@ -74,7 +74,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Metadata
var metadata = new List<ObjectMetadata>();
if (connInfo != null)
{
using (SqlConnection sqlConn = OpenMetadataConnection(connInfo))
using (SqlConnection sqlConn = ConnectionService.OpenSqlConnection(connInfo))
{
ReadMetadata(sqlConn, metadata);
}
@@ -129,7 +129,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Metadata
ColumnMetadata[] metadata = null;
if (connInfo != null)
{
SqlConnection sqlConn = OpenMetadataConnection(connInfo);
SqlConnection sqlConn = ConnectionService.OpenSqlConnection(connInfo);
TableMetadata table = new SmoMetadataFactory().GetObjectMetadata(
sqlConn, metadataParams.Schema,
metadataParams.ObjectName, objectType);
@@ -147,35 +147,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Metadata
}
}
/// <summary>
/// Create a SqlConnection to use for querying metadata
/// </summary>
internal static SqlConnection OpenMetadataConnection(ConnectionInfo connInfo)
{
try
{
// increase the connection timeout to at least 30 seconds and and build connection string
// enable PersistSecurityInfo to handle issues in SMO where the connection context is lost in reconnections
int? originalTimeout = connInfo.ConnectionDetails.ConnectTimeout;
bool? originalPersistSecurityInfo = connInfo.ConnectionDetails.PersistSecurityInfo;
connInfo.ConnectionDetails.ConnectTimeout = Math.Max(30, originalTimeout ?? 0);
connInfo.ConnectionDetails.PersistSecurityInfo = true;
string connectionString = ConnectionService.BuildConnectionString(connInfo.ConnectionDetails);
connInfo.ConnectionDetails.ConnectTimeout = originalTimeout;
connInfo.ConnectionDetails.PersistSecurityInfo = originalPersistSecurityInfo;
// open a dedicated binding server connection
SqlConnection sqlConn = new SqlConnection(connectionString);
sqlConn.Open();
return sqlConn;
}
catch (Exception)
{
}
return null;
}
internal static bool IsSystemDatabase(string database)
{
// compare against master for now