[SQL Migration] SKU recommendation fixes + improvements (#1602)

* Fix null logger resulting in undefined error being surfaced to user

* WIP - implement elastic recommendation model

* WIP - implement elastic recommendation model

* Clean up

* Remove unnecessary content files after updating NuGet version

* Refactor

* Clean up
This commit is contained in:
Raymond Truong
2022-08-16 09:49:12 -07:00
committed by GitHub
parent f4e8acd1a8
commit 004a0b2178
4 changed files with 286 additions and 61 deletions

View File

@@ -74,16 +74,61 @@ namespace Microsoft.SqlTools.ServiceLayer.Migration.Contracts
/// </summary>
public List<SkuRecommendationResult> SqlDbRecommendationResults { get; set; }
/// <summary>
/// How long the SQL DB recommendations took to generate, in milliseconds. Equal to -1 if SQL DB recommendations are not applicable.
/// </summary>
public long SqlDbRecommendationDurationInMs { get; set; }
/// <summary>
/// List of SQL MI recommendation results, if applicable
/// </summary>
public List<SkuRecommendationResult> SqlMiRecommendationResults { get; set; }
/// <summary>
/// How long the SQL MI recommendations took to generate, in milliseconds. Equal to -1 if SQL MI recommendations are not applicable.
/// </summary>
public long SqlMiRecommendationDurationInMs { get; set; }
/// <summary>
/// List of SQL VM recommendation results, if applicable
/// </summary>
public List<SkuRecommendationResult> SqlVmRecommendationResults { get; set; }
/// <summary>
/// How long the SQL VM recommendations took to generate, in milliseconds. Equal to -1 if SQL VM recommendations are not applicable.
/// </summary>
public long SqlVmRecommendationDurationInMs { get; set; }
/// <summary>
/// List of SQL DB recommendation results generated by the elastic model, if applicable
/// </summary>
public List<SkuRecommendationResult> ElasticSqlDbRecommendationResults { get; set; }
/// <summary>
/// How long the SQL DB recommendations took to generate using the elastic model, in milliseconds. Equal to -1 if SQL DB elastic recommendations are not applicable.
/// </summary>
public long ElasticSqlDbRecommendationDurationInMs { get; set; }
/// <summary>
/// List of SQL MI recommendation results generated by the elastic model, if applicable
/// </summary>
public List<SkuRecommendationResult> ElasticSqlMiRecommendationResults { get; set; }
/// <summary>
/// How long the SQL MI recommendations took to generate using the elastic model, in milliseconds. Equal to -1 if SQL MI elastic recommendations are not applicable.
/// </summary>
public long ElasticSqlMiRecommendationDurationInMs { get; set; }
/// <summary>
/// List of SQL VM recommendation results generated by the elastic model, if applicable
/// </summary>
public List<SkuRecommendationResult> ElasticSqlVmRecommendationResults { get; set; }
/// <summary>
/// How long the SQL VM recommendations took to generate using the elastic model, in milliseconds. Equal to -1 if SQL VM elastic recommendations are not applicable.
/// </summary>
public long ElasticSqlVmRecommendationDurationInMs { get; set; }
/// <summary>
/// SQL instance requirements, representing an aggregated view of the performance requirements of the source instance
/// </summary>
@@ -93,6 +138,24 @@ namespace Microsoft.SqlTools.ServiceLayer.Migration.Contracts
/// File paths where the recommendation reports were saved
/// </summary>
public List<string> SkuRecommendationReportPaths { get; set; }
/// <summary>
/// File paths where the recommendation reports generated by the elastic model were saved
/// </summary>
public List<string> ElasticSkuRecommendationReportPaths { get; set; }
}
// Helper class containing recommendation results, durations, and report paths, which is recommendation model-agnostic
internal class RecommendationResultSet {
internal List<SkuRecommendationResult> sqlDbResults;
internal List<SkuRecommendationResult> sqlMiResults;
internal List<SkuRecommendationResult> sqlVmResults;
internal long sqlDbDurationInMs;
internal long sqlMiDurationInMs;
internal long sqlVmDurationInMs;
internal string sqlDbReportPath;
internal string sqlMiReportPath;
internal string sqlVmReportPath;
}
public class GetSkuRecommendationsRequest