This commit is contained in:
Yashwanth Anantharaju 2019-11-01 21:33:38 -04:00 коммит произвёл GitHub
Родитель 50326b4bcf
Коммит efb5f2750e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 556 добавлений и 556 удалений

Просмотреть файл

@ -2,25 +2,16 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Orchestration delays Investigation\n",
"1. Run all cells.\n",
"1. Scroll down to see for any authentication messages\n",
"1. View report at the bottom."
]
],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false,
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
"# These are just defaults will be overwritten if you use nimport pip\n",
"start = \"2019-10-15T20:21:54.0330000Z\"\n",
@ -30,10 +21,24 @@
"hub = \"Actions\"\n",
"url = \"https://notebooksv2.azure.com/yaananth/projects/06OasuNRs6rK/delays.ipynb\"\n",
"baseUrl = \"https://notebooksv2.azure.com/yaananth/projects/06OasuNRs6rK\""
],
"outputs": [],
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false,
"tags": [
"parameters"
]
}
},
{
"cell_type": "code",
"source": [
"%%capture\n",
"!pip install --upgrade nimport azure-kusto-notebooks"
],
"outputs": [],
"execution_count": null,
"metadata": {
"inputHidden": false,
@ -41,21 +46,10 @@
"tags": [
"debug"
]
},
"outputs": [],
"source": [
"%%capture\n",
"!pip install --upgrade nimport azure-kusto-notebooks"
]
}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false
},
"outputs": [],
"source": [
"# Import the things we use\n",
"\n",
@ -83,16 +77,16 @@
"import calendar as cal\n",
"import concurrent.futures\n",
"from azure.kusto.notebooks import utils as akn"
]
},
{
"cell_type": "code",
],
"outputs": [],
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false
}
},
"outputs": [],
{
"cell_type": "code",
"source": [
"params = {\n",
" \"su\": su,\n",
@ -105,44 +99,44 @@
"}\n",
"root = 'devops-pipelines' if os.path.basename(os.getcwd()) != 'devops-pipelines' else ''\n",
"queryPath = os.path.join(root, 'queries')"
]
},
{
"cell_type": "code",
],
"outputs": [],
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false
}
},
"outputs": [],
{
"cell_type": "code",
"source": [
"# authenticate kusto client\n",
"# you will need to copy the token into a browser window for AAD auth. \n",
"client = akn.get_client('https://vso.kusto.windows.net')"
]
},
{
"cell_type": "code",
],
"outputs": [],
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false
}
},
"outputs": [],
{
"cell_type": "code",
"source": [
"# authenticate kusto client\n",
"# you will need to copy the token into a browser window for AAD auth. \n",
"icm_client = akn.get_client('https://icmcluster.kusto.windows.net')"
]
},
{
"cell_type": "code",
],
"outputs": [],
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false
}
},
"outputs": [],
{
"cell_type": "code",
"source": [
"q_loc = os.path.join(queryPath, \"LocationName.csl\")\n",
"q_whatChanged = os.path.join(queryPath, \"WhatChanged.csl\")\n",
@ -193,16 +187,16 @@
"\n",
"q_mdmDf = akn.to_dataframe_from_future(p12)\n",
"params[\"mdmAccount\"] = q_mdmDf[\"monitoringAccount\"][0]"
]
},
{
"cell_type": "code",
],
"outputs": [],
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false
}
},
"outputs": [],
{
"cell_type": "code",
"source": [
"q_spike = os.path.join(delaysPath, \"OrchestrationLogSpike.csl\")\n",
"q_parallelism = os.path.join(delaysPath, \"Parallelism.csl\")\n",
@ -234,16 +228,16 @@
" parResultsDfs = [dff.result() for dff in concurrent.futures.as_completed(p_dataframe_futures)]\n",
"sfsResults = None\n",
"sfsResults = None"
]
},
{
"cell_type": "code",
],
"outputs": [],
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false
}
},
"outputs": [],
{
"cell_type": "code",
"source": [
"q_loadPerHost = os.path.join(delaysPath, \"LoadPerHost.csl\")\n",
"# utility functions\n",
@ -349,7 +343,7 @@
" \n",
"r('## Parallelism')\n",
"for parResultsDf in parResultsDfs:\n",
" if len(parResultsDf.C.values) > 0:",
" if len(parResultsDf.C.values) > 0: \n",
" usage = parResultsDf.C.values[0]\n",
" times = parResultsDf.sampleTime.values[0]\n",
" hostId = parResultsDf.HostId[0]\n",
@ -463,16 +457,16 @@
"\n",
"Markdown(content)\n",
"# print(content)"
]
},
{
"cell_type": "code",
],
"outputs": [],
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false
}
},
"outputs": [],
{
"cell_type": "code",
"source": [
"# visualize delays\n",
"import plotly\n",
@ -516,17 +510,23 @@
"\n",
"data = [delays, changed, mitigations]\n",
"plotly.offline.iplot(data)"
]
},
{
"cell_type": "code",
],
"outputs": [],
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false
}
},
{
"cell_type": "code",
"source": [],
"outputs": [],
"source": []
"execution_count": null,
"metadata": {
"inputHidden": false,
"outputHidden": false
}
}
],
"metadata": {
@ -534,24 +534,24 @@
"name": "python3"
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3",
"language": "python",
"name": "python3"
"display_name": "Python 3"
},
"language_info": {
"name": "python",
"version": "3.7.4",
"mimetype": "text/x-python",
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"nbconvert_exporter": "python",
"file_extension": ".py"
},
"nteract": {
"version": "0.15.0"
"version": "0.14.5"
}
},
"nbformat": 4,