Open LoopedBard3 opened 3 weeks ago
fyi: @radekdoulik
Instead of updating the query in our autofiler code everytime, I'm working on a stored function for our Azure Data Explorer cluster that we can define this in instead. Here is the function I have defined as a work-in-progress so far and it is already available on our ADX to experiment with:
.create-or-alter function GetHistoricalDataWithComparisons(test: string, counter: string = "", repo: string = "", branch: string = "", after: datetime = datetime(null))
{
let afterValue = iff(isnull(after), ago(60d), after);
Measurements
| where repo == "" or BuildRepo == repo
| where (branch == "" and (BuildBranch == "refs/heads/main" or BuildBranch == "9.0")) or BuildBranch == branch
| where TestName == test
| where iff(counter == "", TestCounterTopCounter, TestCounterName == counter)
| where BuildTimeStamp > afterValue
| summarize arg_max(QualityLevel, *) by RunId, TestId
| extend ConfigShort = strcat(
iff(RunConfigurationsCompilationMode == "wasm", "-wasm", ""),
iff(RunConfigurationsRunKind == "micro_mono", "-mono", ""),
iff(RunConfigurationsExperimentName != "", strcat("-", RunConfigurationsExperimentName), ""),
iff(RunConfigurationsPgoType != "", strcat("-", RunConfigurationsPgoType), ""),
iff(RunConfigurationsHybridGlobalization != "", "-HybridGlobalization", ""),
iff(RunConfigurationsR2RType != "", strcat("-", RunConfigurationsR2RType), ""),
iff(tobool(RunConfigurationsAot) or tobool(RunConfigurationsMonoAot),"-AOT", ""),
iff(tobool(RunConfigurationsMonoInterpreter),"-Interp", ""),
iff(tostring(RunConfigurations["RuntimeType"]) != "", strcat("-", tostring(RunConfigurations["RuntimeType"])), ""),
iff(tobool(RunConfigurations["iOSStripSymbols"]),"-iOSStripSymbols", ""),
iff(tobool(RunConfigurationsLlvm) or tobool(RunConfigurationsIosLlvmBuild),"-LLVM", ""),
iff(tobool(RunConfigurationsJsEngine),strcat("-", RunConfigurationsJsEngine), ""),
iff(RunConfigurationsPhysicalPromotionType != "", strcat("-", RunConfigurationsPhysicalPromotionType), ""))
| extend Series = strcat(FriendlyQueueName(RunQueue), iff(BuildArchitecture == "x86", "-x86", ""), ConfigShort)
}
Then an example usage of this which renders the chart would be
GetHistoricalDataWithComparisons(@'System.Memory.Span<Byte>.BinarySearch(Size: 512)', after=datetime(2024-08-22T09:01:51.8330745+00:00))
// | where RunConfigurationsRunKind == "micro_mono" or RunConfigurationsCompilationMode == "wasm"
| project BuildTimeStamp, Result=round(TestCounterResultAverage, 3), Series
| render timechart with (series=Series, xcolumn=BuildTimeStamp, ycolumns=Result, xtitle='Date', ytitle='Time (ns)')
So we would just generate this query inside our auto-filter instead of the full query.
What did we think of this approach? For most microbenchmarks this causes way too many series by default so need to decide what might be some sensible default filters to apply on top of the result from GetHistoricalDataWithComparisons.
Instead of updating the query in our autofiler code everytime, I'm working on a stored function for our Azure Data Explorer cluster that we can define this in instead. Here is the function I have defined as a work-in-progress so far and it is already available on our ADX to experiment with:
.create-or-alter function GetHistoricalDataWithComparisons(test: string, counter: string = "", repo: string = "", branch: string = "", after: datetime = datetime(null)) { let afterValue = iff(isnull(after), ago(60d), after); Measurements | where repo == "" or BuildRepo == repo | where (branch == "" and (BuildBranch == "refs/heads/main" or BuildBranch == "9.0")) or BuildBranch == branch | where TestName == test | where iff(counter == "", TestCounterTopCounter, TestCounterName == counter) | where BuildTimeStamp > afterValue | summarize arg_max(QualityLevel, *) by RunId, TestId | extend ConfigShort = strcat( iff(RunConfigurationsCompilationMode == "wasm", "-wasm", ""), iff(RunConfigurationsRunKind == "micro_mono", "-mono", ""), iff(RunConfigurationsExperimentName != "", strcat("-", RunConfigurationsExperimentName), ""), iff(RunConfigurationsPgoType != "", strcat("-", RunConfigurationsPgoType), ""), iff(RunConfigurationsHybridGlobalization != "", "-HybridGlobalization", ""), iff(RunConfigurationsR2RType != "", strcat("-", RunConfigurationsR2RType), ""), iff(tobool(RunConfigurationsAot) or tobool(RunConfigurationsMonoAot),"-AOT", ""), iff(tobool(RunConfigurationsMonoInterpreter),"-Interp", ""), iff(tostring(RunConfigurations["RuntimeType"]) != "", strcat("-", tostring(RunConfigurations["RuntimeType"])), ""), iff(tobool(RunConfigurations["iOSStripSymbols"]),"-iOSStripSymbols", ""), iff(tobool(RunConfigurationsLlvm) or tobool(RunConfigurationsIosLlvmBuild),"-LLVM", ""), iff(tobool(RunConfigurationsJsEngine),strcat("-", RunConfigurationsJsEngine), ""), iff(RunConfigurationsPhysicalPromotionType != "", strcat("-", RunConfigurationsPhysicalPromotionType), "")) | extend Series = strcat(FriendlyQueueName(RunQueue), iff(BuildArchitecture == "x86", "-x86", ""), ConfigShort) } Then an example usage of this which renders the chart would be
GetHistoricalDataWithComparisons(@'System.Memory.Span
.BinarySearch(Size: 512)', after=datetime(2024-08-22T09:01:51.8330745+00:00)) // | where RunConfigurationsRunKind == "micro_mono" or RunConfigurationsCompilationMode == "wasm" | project BuildTimeStamp, Result=round(TestCounterResultAverage, 3), Series | render timechart with (series=Series, xcolumn=BuildTimeStamp, ycolumns=Result, xtitle='Date', ytitle='Time (ns)') So we would just generate this query inside our auto-filter instead of the full query. What did we think of this approach? For most microbenchmarks this causes way too many series by default so need to decide what might be some sensible default filters to apply on top of the result from GetHistoricalDataWithComparisons.
Looking good @caaavik-msft, thank you! I think for Mono, it is sensible to have | where RunConfigurationsRunKind == "micro_mono" or RunConfigurationsCompilationMode == "wasm"
enabled by default. It would be nice to have e.g., one CoreCLR job included as well just for comparison between CoreCLR and Mono. However, if that would be too complicated, I think having Mono-only by default is good enough and if we need to, we can always comment it out.
Request is to update the generated ADX query in autofiled issues to include WASM similar to how Mono is included. New base query is as follows: