Add ability to create sessions from templates, and list existing sessions (#671)

* Initial changes to connect to existing sessions

* Creating new profiler sessions

* Some session template changes

* Fixing errors

* Cleaning up comments, string constants, and formatting

* Removing commented code
This commit is contained in:
Madeline MacDonald
2018-08-02 12:50:26 -07:00
committed by GitHub
parent e8360ef68e
commit 4b9807f0cf
14 changed files with 406 additions and 117 deletions

View File

@@ -0,0 +1,56 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Collections.Generic;
namespace Microsoft.SqlTools.ServiceLayer.Profiler.Contracts
{
/// <summary>
/// Class that contains data for a single profile event
/// </summary>
public class ProfilerSessionTemplate
{
/// <summary>
/// Initialize a new ProfilerEvent with required parameters
/// </summary>
public ProfilerSessionTemplate(string name, string defaultView, string createStatement)
{
this.Name = name;
this.DefaultView = defaultView;
this.CreateStatement = createStatement;
}
/// <summary>
/// Profiler event name
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Profiler event timestamp
/// </summary>
public string DefaultView { get; private set; }
/// <summary>
/// Profiler event timestamp
/// </summary>
public string CreateStatement { get; private set; }
/// <summary>
/// Equals method
/// </summary>
public bool Equals(ProfilerSessionTemplate t)
{
// if parameter is null return false:
if ((object)t == null)
{
return false;
}
return this.Name == t.Name
&& this.DefaultView == t.DefaultView
&& this.CreateStatement == t.CreateStatement;
}
}
}