mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
fixed couple of issues in the perf tests (#693)
This commit is contained in:
@@ -136,7 +136,7 @@ namespace Microsoft.SqlTools.ServiceLayer.PerfTests
|
|||||||
await testService.RunQueryAndWaitToStart(queryTempFile.FilePath, 50000);
|
await testService.RunQueryAndWaitToStart(queryTempFile.FilePath, 50000);
|
||||||
await testService.ExecuteWithTimeout(timer, 500000, async () =>
|
await testService.ExecuteWithTimeout(timer, 500000, async () =>
|
||||||
{
|
{
|
||||||
var queryResult = await testService.ExecuteSubset(queryTempFile.FilePath, 0, 0, 0, 100);
|
var queryResult = await testService.ExecuteSubset(queryTempFile.FilePath, 0, 0, 0, 50);
|
||||||
if (queryResult != null)
|
if (queryResult != null)
|
||||||
{
|
{
|
||||||
Assert.NotNull(queryResult);
|
Assert.NotNull(queryResult);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||||
@@ -434,9 +435,16 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
|
|||||||
for (int i = 0; i < TestRunner.Instance.NumberOfRuns; i++)
|
for (int i = 0; i < TestRunner.Instance.NumberOfRuns; i++)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Iteration Number: " + i);
|
Console.WriteLine("Iteration Number: " + i);
|
||||||
|
try
|
||||||
|
{
|
||||||
await testToRun(timer);
|
await testToRun(timer);
|
||||||
}
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Iteration Failed: " + ex.Message);
|
||||||
|
}
|
||||||
|
Thread.Sleep(5000);
|
||||||
|
}
|
||||||
timer.Print(testName);
|
timer.Print(testName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,11 +73,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
|
|||||||
double elapsed = Percentile(iterationArray, 0.5);
|
double elapsed = Percentile(iterationArray, 0.5);
|
||||||
var currentColor = Console.ForegroundColor;
|
var currentColor = Console.ForegroundColor;
|
||||||
Console.ForegroundColor = ConsoleColor.Green;
|
Console.ForegroundColor = ConsoleColor.Green;
|
||||||
Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "Test Name: {0} Run time in milliSeconds: {1}", testName, TotalMilliSeconds));
|
Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "Test Name: {0} Run time in milliSeconds: {1}", testName, elapsed));
|
||||||
Console.ForegroundColor = currentColor;
|
Console.ForegroundColor = currentColor;
|
||||||
string resultContent = Newtonsoft.Json.JsonConvert.SerializeObject(new TestResult
|
string resultContent = Newtonsoft.Json.JsonConvert.SerializeObject(new TestResult
|
||||||
{
|
{
|
||||||
ElapsedTime = TotalMilliSeconds,
|
ElapsedTime = elapsed,
|
||||||
MetricValue = elapsed,
|
MetricValue = elapsed,
|
||||||
PrimaryMetric = "ElapsedTimeMetric",
|
PrimaryMetric = "ElapsedTimeMetric",
|
||||||
Iterations = iterationArray,
|
Iterations = iterationArray,
|
||||||
|
|||||||
Reference in New Issue
Block a user