Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Internal] Query: Adds performance testing for OptimisticDirectExecution pipeline #3839

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
01e651a
Infrastructure for performance testing with ODE pipeline.
akotalwar May 8, 2023
7a2b68c
Resolve comments
akotalwar May 18, 2023
b0b5912
Removed randomization from data creation process
akotalwar Jun 5, 2023
c8f4327
Fixed comments
akotalwar Jul 18, 2023
24a67d8
Removed Query and EnableODE from QueryStatisticsMetrics, as they do n…
akotalwar Jul 21, 2023
41293fb
Removed try catch to make CreateItemAsync call always succeed
akotalwar Jul 24, 2023
6b15379
Removed one liner functions
akotalwar Jul 24, 2023
a6c143d
Merge branch 'master' into users/akotalwar/PerformanceTestingForOde
akotalwar Jul 25, 2023
9851c4f
Removed code from MetricsSerializer and QueryStatisticsDatumVisitor f…
akotalwar Jul 28, 2023
cc7bd5c
Merge branch 'users/akotalwar/PerformanceTestingForOde' of https://gi…
akotalwar Jul 28, 2023
b0c9c35
Fixed comments
akotalwar Aug 2, 2023
272b3e6
Merge branch 'master' into users/akotalwar/PerformanceTestingForOde
akotalwar Aug 2, 2023
0d03286
Removed request Charge check
akotalwar Aug 2, 2023
3079342
Merge branch 'users/akotalwar/PerformanceTestingForOde' of https://gi…
akotalwar Aug 2, 2023
3e4923d
Bug in Debug Assert
akotalwar Aug 4, 2023
e1c9b90
Test
akotalwar Aug 4, 2023
7d2c009
Bug in debug assert fix
akotalwar Aug 4, 2023
c5cfef2
Fixed second bug in Metrics Accumalator class
akotalwar Aug 4, 2023
050a14b
Added ignore flag to ode perf tests so that they do not run on every …
akotalwar Aug 5, 2023
cba35e2
Added comment explaining the Ignore flag.
akotalwar Aug 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,112 @@ public void Serialize(TextWriter textWriter, QueryStatisticsDatumVisitor querySt
}
textWriter.Flush();
}

public void ODESerialization(TextWriter textWriter, QueryStatisticsDatumVisitor queryStatisticsDatumVisitor, int numberOfIterations, bool rawData)
akotalwar marked this conversation as resolved.
Show resolved Hide resolved
{
if (rawData)
akotalwar marked this conversation as resolved.
Show resolved Hide resolved
{
textWriter.WriteLine();
textWriter.WriteLine(PrintQueryMetrics);
textWriter.Write(string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\",\"{6}\"", "Query", "ODE", "RUCharge", "BackendTime",
akotalwar marked this conversation as resolved.
Show resolved Hide resolved
"TransitTime", "ClientTime", "EndToEndTime"));
textWriter.WriteLine();
double totalClientTime = 0;
double totalBackendTime = 0;
double totalEndToEndTime = 0;
double totalTransitTime = 0;
double totalRU = 0;
int count = 0;
string prevQuery = "";
bool prevOde = default;
Guid prevCorrelatedActivityId = default;

foreach (QueryStatisticsMetrics metrics in queryStatisticsDatumVisitor.QueryMetricsList)
{
if (count == 0)
{
prevCorrelatedActivityId = metrics.CorrelatedActivityId;
akotalwar marked this conversation as resolved.
Show resolved Hide resolved
}

double transitTime = metrics.Created + metrics.ChannelAcquisitionStarted + metrics.Pipelined + metrics.Received + metrics.Completed;
double backendTime = metrics.TotalQueryExecutionTime;

if (metrics.CorrelatedActivityId == prevCorrelatedActivityId)
{
totalClientTime += metrics.EndToEndTime - (backendTime + transitTime);
totalBackendTime += backendTime;
totalEndToEndTime += metrics.EndToEndTime;
totalTransitTime += transitTime;
totalRU += metrics.RUCharge;
prevQuery = metrics.Query;
prevOde = metrics.EnableOde;
prevCorrelatedActivityId = metrics.CorrelatedActivityId;

}
else
{
textWriter.WriteLine(string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\",\"{6}\"",
akotalwar marked this conversation as resolved.
Show resolved Hide resolved
prevQuery, prevOde, totalRU, totalBackendTime, totalTransitTime, totalClientTime, totalEndToEndTime));

totalClientTime = metrics.EndToEndTime - (backendTime + transitTime);
totalBackendTime = backendTime;
totalEndToEndTime = metrics.EndToEndTime;
totalTransitTime = transitTime;
totalRU = metrics.RUCharge;
prevCorrelatedActivityId = metrics.CorrelatedActivityId;
prevQuery = metrics.Query;
prevOde = metrics.EnableOde;
}

count++;
}

textWriter.WriteLine(string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\",\"{6}\"",
prevQuery, prevOde, totalRU, totalBackendTime, totalTransitTime, totalClientTime, totalEndToEndTime));
}
else
{
textWriter.WriteLine();
textWriter.WriteLine(PrintQueryMetrics);
textWriter.Write(string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\"", "Query", "ODE", "RUCharge", "EndToEndTime"));
textWriter.WriteLine();

string prevQuery = "";
bool prevOde = default;
double totalEndToEndTime = 0;
double totalRU = 0;
int count = 0;

foreach (QueryStatisticsMetrics metrics in queryStatisticsDatumVisitor.QueryMetricsList)
{
if (count == 0)
{
prevQuery = metrics.Query;
prevOde = metrics.EnableOde;
}

if (metrics.Query == prevQuery && metrics.EnableOde == prevOde)
{
totalEndToEndTime += metrics.EndToEndTime;
totalRU += metrics.RUCharge;
}
else
{
textWriter.WriteLine(string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\"",
prevQuery, prevOde, totalRU/numberOfIterations, totalEndToEndTime/numberOfIterations));

totalEndToEndTime = metrics.EndToEndTime;
totalRU = metrics.RUCharge;
prevQuery = metrics.Query;
prevOde = metrics.EnableOde;
}

count++;
}

textWriter.WriteLine(string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\"",
prevQuery, prevOde, totalRU / numberOfIterations, totalEndToEndTime / numberOfIterations));
}
}
}
}
Loading