mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-23 17:24:12 -05:00
[Feature] SKU recommendations in SQL migration extension (#1399)
* Initial check in for SQL migration SKU recommendation feature (#1362) Co-authored-by: Raymond Truong <ratruong@microsoft.com> * Integration test for Get SKU Recommendation. (#1377) * Integration test for Get SKU Recommendation. * Addressing comments - 1) Moving sample files to data folder. 2) Changed Assert for Positive Justification. Ideally for MI we are expecting ~6 justifications but this might change so sticking with 'recommendation should have atleast one positive justification'. * Implement start/stop perf data collection (#1369) * Add SqlInstanceRequirements to SKU recommendation output (#1378) * test for data collection start and stop (#1395) * improve error handling, add RefreshPerfDataCollection (#1393) * WIP - refresh data collection * Capture messages before logging * Update Microsoft.SqlServer.Migration.Assessment NuGet version (#1402) * Update NuGet version to 1.0.20220208.23, update assessment metadata * Update SKU recommendation metadata * Include preview SKUs * Clear message/error queue after refreshing * Clean up * Add 'IsCollecting' to RefreshPerfDataCollection (#1405) Co-authored-by: Neetu Singh <23.neetu@gmail.com>
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Migration.Contracts
|
||||
{
|
||||
public class StartPerfDataCollectionParams
|
||||
{
|
||||
/// <summary>
|
||||
/// Uri identifier for the connection
|
||||
/// </summary>
|
||||
public string OwnerUri { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Folder from which collected performance data will be written to
|
||||
/// </summary>
|
||||
public string DataFolder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Interval at which performance data will be collected, in seconds
|
||||
/// </summary>
|
||||
public int PerfQueryIntervalInSec { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Interval at which static (common) data will be collected, in seconds
|
||||
/// </summary>
|
||||
public int StaticQueryIntervalInSec { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of iterations of performance data collection to run before aggregating and saving to disk
|
||||
/// </summary>
|
||||
public int NumberOfIterations { get; set; }
|
||||
}
|
||||
|
||||
public class StopPerfDataCollectionParams
|
||||
{
|
||||
// TO-DO: currently stop data collection doesn't require any parameters
|
||||
}
|
||||
|
||||
public class RefreshPerfDataCollectionParams
|
||||
{
|
||||
/// <summary>
|
||||
/// The last time data collection status was refreshed
|
||||
/// </summary>
|
||||
public DateTime LastRefreshedTime { get; set; }
|
||||
}
|
||||
|
||||
public class StartPerfDataCollectionResult
|
||||
{
|
||||
/// <summary>
|
||||
/// The time data collection started
|
||||
/// </summary>
|
||||
public DateTime DateTimeStarted { get; set; }
|
||||
}
|
||||
|
||||
public class StopPerfDataCollectionResult
|
||||
{
|
||||
/// <summary>
|
||||
/// The time data collection stopped
|
||||
/// </summary>
|
||||
public DateTime DateTimeStopped { get; set; }
|
||||
}
|
||||
|
||||
public class RefreshPerfDataCollectionResult
|
||||
{
|
||||
/// <summary>
|
||||
/// List of status messages captured during data collection
|
||||
/// </summary>
|
||||
public List<string> Messages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of error messages captured during data collection
|
||||
/// </summary>
|
||||
public List<string> Errors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The last time data collecton status was refreshed
|
||||
/// </summary>
|
||||
public DateTime RefreshTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not data collection is currently running
|
||||
/// </summary>
|
||||
public bool IsCollecting { get; set; }
|
||||
}
|
||||
|
||||
public class StartPerfDataCollectionRequest
|
||||
{
|
||||
public static readonly
|
||||
RequestType<StartPerfDataCollectionParams, StartPerfDataCollectionResult> Type =
|
||||
RequestType<StartPerfDataCollectionParams, StartPerfDataCollectionResult>.Create("migration/startperfdatacollection");
|
||||
}
|
||||
|
||||
public class StopPerfDataCollectionRequest
|
||||
{
|
||||
public static readonly
|
||||
RequestType<StopPerfDataCollectionParams, StopPerfDataCollectionResult> Type =
|
||||
RequestType<StopPerfDataCollectionParams, StopPerfDataCollectionResult>.Create("migration/stopperfdatacollection");
|
||||
}
|
||||
|
||||
public class RefreshPerfDataCollectionRequest
|
||||
{
|
||||
public static readonly
|
||||
RequestType<RefreshPerfDataCollectionParams, RefreshPerfDataCollectionResult> Type =
|
||||
RequestType<RefreshPerfDataCollectionParams, RefreshPerfDataCollectionResult>.Create("migration/refreshperfdatacollection");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user