Files
sqltoolsservice/src/Microsoft.SqlTools.ServiceLayer/QueryStore/Contracts/GetOverallResourceConsumptionReport.cs
Benjin Dubishar 25c18d3390 Query Store Service (#2171)
* Checkpoint

* Checkpoint

* Checkpoint

* checkpoint

* Hooking in calls to QueryExecutionService

* adding cases

* Fleshing out report handlers

* Adding parameter converters

* Adding sqlparam declarations for Top Resource Consumers and Forced Plans

* swapping to object-object to centralize conversion for sqlparams

* Adding sqlparams for GetTrackedQueries

* Added sqlparams for High Variation

* Added Overall ResourceConumption

* Adding params for regressed queries

* Removing WithWaitStats calls, since they're automatically used within QSM when waitstats is an available statistic#

* Adding PlanSummary handlers

* cleaning up orderable queries

* initial test mockout

* adding basic (incorrect) parameter translation

* first test passing, datetimeoffset swapped to ISO format

* Adding test baselines

* Updating nuget package

* Adding get/set

* Adding get/set for result object

* Switching to parameter-less constructor

* Swapping TimeInterval for string-based BasicTimeInterval

* Removing unnecessary usings

* Adding back params comments

* Fixing up request docstrings

* comment tweak

* fix tests failing in pipeline because of line endings not matching

* removing unnecessary usings

* Setting tests to generate queries in UTC for test stability

* Normalizing line endings

---------

Co-authored-by: Kim Santiago <kisantia@microsoft.com>
2023-09-01 10:56:39 -07:00

49 lines
1.7 KiB
C#

//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlServer.Management.QueryStoreModel.Common;
using Microsoft.SqlServer.Management.QueryStoreModel.OverallResourceConsumption;
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
#nullable disable
namespace Microsoft.SqlTools.ServiceLayer.QueryStore.Contracts
{
/// <summary>
/// Parameters for getting an Overall Resource Consumption report
/// </summary>
public class GetOverallResourceConsumptionReportParams : QueryConfigurationParams<OverallResourceConsumptionConfiguration>
{
/// <summary>
/// Time interval for the report
/// </summary>
public BasicTimeInterval SpecifiedTimeInterval { get; set; }
/// <summary>
/// Bucket interval for the report
/// </summary>
public BucketInterval SpecifiedBucketInterval { get; set; }
public override OverallResourceConsumptionConfiguration Convert()
{
OverallResourceConsumptionConfiguration result = base.Convert();
result.SpecifiedTimeInterval = SpecifiedTimeInterval.Convert();
result.SelectedBucketInterval = SpecifiedBucketInterval;
return result;
}
}
/// <summary>
/// Gets the query for an Overall Resource Consumption report
/// </summary>
public class GetOverallResourceConsumptionReportRequest
{
public static readonly RequestType<GetOverallResourceConsumptionReportParams, QueryStoreQueryResult> Type
= RequestType<GetOverallResourceConsumptionReportParams, QueryStoreQueryResult>.Create("queryStore/getOverallResourceConsumptionReport");
}
}