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

Benchmark metrics dashboard #3932

Merged
merged 2 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -152,9 +152,16 @@
"type": "string",
"defaultValue": "CosmosDBBenchmarkTestAppInsights",
"metadata": {
"description": "Specifies Application Insights Account Nmae"
"description": "Specifies Application Insights Account Name"
}
}
},
"dashboardName": {
"type": "string",
"defaultValue": "Cosmos Benchmark Statistics",
"metadata": {
"description": "Specifies Application Insights Dashboard Name"
}
}
},
"variables": {
"vmName": "[concat(parameters('projectName'), '-vm')]",
Expand All @@ -165,7 +172,8 @@
"cloudInitScriptUrl": "[concat('https://raw.githubusercontent.com/',parameters('benchmarkingToolsRepoName'),'/',parameters('benchmarkingToolsBranchName'),'/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/system/cloud-init.txt')]",
"vmScriptExtensionScriptUrl": "[concat('https://raw.githubusercontent.com/',parameters('benchmarkingToolsRepoName'),'/',parameters('benchmarkingToolsBranchName'),'/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/execute.sh')]",
"customScriptUrl": "[concat('https://raw.githubusercontent.com/',parameters('benchmarkingToolsRepoName'),'/',parameters('benchmarkingToolsBranchName'),'/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh')]",
"vmScriptExtensionScriptName": "execute.sh"
"vmScriptExtensionScriptName": "execute.sh",
"appInsightsResourceIds": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/microsoft.insights/components/', parameters('applicationInsightsName'))]"
},
"resources": [
{
Expand Down Expand Up @@ -392,7 +400,181 @@
"name": "vmextensioncopy",
"count": "[parameters('vmCount')]"
}
},
{
"name": "CosmosDBBenchmarkDashboard",
"type": "Microsoft.Portal/dashboards",
"location": "[resourceGroup().location]",
"apiVersion": "2015-08-01-preview",
"tags": {
"hidden-title": "[parameters('dashboardName')]"
},

"properties": {
"lenses": {
"0": {
"order": 0,
"parts": {
"0": {
"position": {
"x": 0,
"y": 0,
"colSpan": 11,
"rowSpan": 5
},
"metadata": {
"inputs": [
{
"name": "resourceTypeMode",
"isOptional": true
},
{
"name": "ComponentId",
"isOptional": true
},
{
"name": "Scope",
"value": {
"resourceIds": [
"[variables('appInsightsResourceIds')]"
]
},
"isOptional": true
},
{
"name": "PartId",
"value": "104528fc-0216-49c6-bf70-fffe9d37f93d",
"isOptional": true
},
{
"name": "Version",
"value": "2.0",
"isOptional": true
},
{
"name": "TimeRange",
"isOptional": true
},
{
"name": "DashboardId",
"isOptional": true
},
{
"name": "DraftRequestParameters",
"isOptional": true
},
{
"name": "Query",
"value": "customMetrics\n| where name == \"ReadOperationLatencyInMs\" and timestamp > ago(1d)\n| summarize\n percentile(value, 50),\n percentile(value, 75),\n percentile(value, 90),\n percentile(value, 95),\n percentile(value, 99),\n percentile(value, 99.9),\n percentile(value, 99.99)\n by ts = bin(timestamp, 5s)\n| render timechart \n\n",
"isOptional": true
},
{
"name": "ControlType",
"value": "FrameControlChart",
"isOptional": true
},
{
"name": "SpecificChart",
"value": "Line",
"isOptional": true
},
{
"name": "PartTitle",
"value": "Analytics",
"isOptional": true
},
{
"name": "PartSubTitle",
"value": "CosmosDBBenchmarkTestAppInsights",
"isOptional": true
},
{
"name": "Dimensions",
"value": {
"xAxis": {
"name": "ts",
"type": "datetime"
},
"yAxis": [
{
"name": "percentile_value_50",
"type": "real"
},
{
"name": "percentile_value_75",
"type": "real"
},
{
"name": "percentile_value_90",
"type": "real"
},
{
"name": "percentile_value_95",
"type": "real"
}
],
"splitBy": [],
"aggregation": "Sum"
},
"isOptional": true
},
{
"name": "LegendOptions",
"value": {
"isEnabled": true,
"position": "Bottom"
},
"isOptional": true
},
{
"name": "IsQueryContainTimeRange",
"value": true,
"isOptional": true
}
],
"type": "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart",
"settings": {}
}
}
}
}
},
"metadata": {
"model": {
"timeRange": {
"value": {
"relative": {
"duration": 24,
"timeUnit": 1
}
},
"type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"
},
"filterLocale": {
"value": "en-us"
},
"filters": {
"value": {
"MsPortalFx_TimeRange": {
"model": {
"format": "utc",
"granularity": "auto",
"relative": "24h"
},
"displayCache": {
"name": "UTC Time",
"value": "Past 24 hours"
},
"filteredPartIds": [
"StartboardPart-LogsDashboardPart-4f9d44ab-efbe-4310-8809-63ae942a3091"
]
}
}
}
}
}
}
}
],
"outputs": {
"results": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ public class BenchmarkConfig
[Option(Required = false, HelpText = "Logging context name. The default value is \"CosmosDBBenchmarkLoggingContext\"")]
public string LoggingContextIdentifier { get; set; } = "CosmosDBBenchmarkLoggingContext";

[Option(Required = false, HelpText = "Metrics reporting interval in seconds")]
public int MetricsReportingIntervalInSec { get; set; } = 5;

[Option(Required = false, HelpText = "Application Insights instrumentation key")]
public string AppInsightsInstrumentationKey { get; set; }

[Option(Required = false, HelpText = "The reservoir sample size.")]
public int ReservoirSampleSize { get; set; } = 1028;

[Option(Required = false, HelpText = "Logging context name. The default value is \"CosmosDBBenchmarkLoggingContext\"")]
public string LoggingContextIdentifier { get; set; } = "CosmosDBBenchmarkLoggingContext";

internal int GetTaskCount(int containerThroughput)
{
int taskCount = this.DegreeOfParallelism;
Expand Down