From ec78175af91192374a3b923f97aef58207f706da Mon Sep 17 00:00:00 2001 From: Umar Farooq Ghumman Date: Wed, 5 Jun 2024 09:36:16 -0500 Subject: [PATCH 1/2] Update QueryProfiler UI Page - Restructured the page - Added hints --- project/ui/qprof_main.ipynb | 333 +++++++++++++++++++----------------- 1 file changed, 178 insertions(+), 155 deletions(-) diff --git a/project/ui/qprof_main.ipynb b/project/ui/qprof_main.ipynb index a146abb4..9da47dec 100644 --- a/project/ui/qprof_main.ipynb +++ b/project/ui/qprof_main.ipynb @@ -2,25 +2,10 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "bdf3c956-2080-4d20-9263-def117c59119", "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "2d3fe546e9fd4c4a8a4a7f902ee1b334", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "HBox(children=(HTML(value=\"Load from existing\"\"\")\n", + "left_section = widgets.VBox([left_heading,tab], layout= {\"margin\" :\"0px 0px 0px 50px\"})" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "88e269a3-38f0-411a-8eac-968a00a6d9e3", "metadata": {}, "outputs": [], @@ -333,25 +336,10 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "3cff15cf-0b8d-4651-89dd-026b4e8c9121", "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "f1af660228604845a264d2e64e02ae6a", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Accordion(children=(VBox(children=(HTML(value='\\nYou can query the ``query_requests`` table to search for the …" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "request_label_input = widgets.Text(description = \"Request label\", placeholder = \"Enter part of label\")\n", "request_label_check = widgets.Checkbox(value=False,description='Exact')\n", @@ -363,7 +351,6 @@ "query_search_widget = widgets.HBox([query_search_input, query_search_check])\n", "search_box_vbox = widgets.VBox([search_box_test, request_label_widget, query_search_widget, button_01, output_01])\n", "search_box = widgets.Accordion(children=[search_box_vbox], titles=('Search for a query',))\n", - "display(search_box)\n", "\n", "def on_button_clicked_01(b):\n", " output_01.clear_output(wait=True)\n", @@ -389,33 +376,37 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "59c1d00b-0ecd-429f-8d39-af3b0ca8f215", "metadata": {}, "outputs": [], "source": [ "transaction = widgets.Text(description = \"Transaction ID\", placeholder = \"Enter a Transaction ID\", layout=widgets.Layout(width='300px'))\n", "transaction.style.description_width = '100px'\n", + "transaction_combo = widgets.HBox([transaction, create_tooltip(\"Enter the transaction ID of the query that you want to profile. You can search for the transaction ID from the search box above.\")])\n", "statement = widgets.Text(description = \"Statement ID\", placeholder = \"Enter a Statement ID\", layout=widgets.Layout(width='300px'))\n", - "statement.style.description_width = '100px'\n" + "statement.style.description_width = '100px'\n", + "statement_combo = widgets.HBox([statement, create_tooltip(\"Enter the statement ID of the query that you want to profile. You can search for the statement ID from the search box above.\")])\n" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "id": "c18c43b6-9bae-4371-aec1-87d35a30160e", "metadata": {}, "outputs": [], "source": [ - "key_2 = widgets.Text(description = \"Key\", placeholder = \"Enter Key (Optional)\", layout=widgets.Layout(width='300px'))\n", + "key_2 = widgets.Text(description = \"Key (Optional)\", placeholder = \"Enter a unique Key\", layout=widgets.Layout(width='300px'))\n", "key_2.style.description_width = '100px'\n", + "key_2_combo = widgets.HBox([key_2, create_tooltip(\"Enter a unique key that will be used to save your profile tables. If your key is already in use then a random key will be generated to store the data. Note that you will need the combination of schema and the key to load your saved data. If you do not provide this, you may not be able to export your profile tables to a tar file.\")])\n", "target_schema_2 = widgets.Text(description = \"Target Schema (Optional)\", placeholder = \"Enter Schema\",layout=widgets.Layout(width='300px'))\n", - "target_schema_2.style.description_width = '150px'" + "target_schema_2.style.description_width = '150px'\n", + "target_schema_2_combo = widgets.HBox([target_schema_2, create_tooltip(\"Enter the schema in which you would like to store the profile data. Note that you will need the combination of schema and the key to load your saved data. If you do not provide this, you may not be able to export your profile tables to a tar file.\")])" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "69be4766-8633-4bd9-8588-42967d27a6fb", "metadata": {}, "outputs": [], @@ -439,12 +430,12 @@ " reset_values(statement_val = statement_val, transaction_val = transaction_val, target_schema_val_2 = target_schema_val_2, key_val_2 = key_val_2)\n", "\n", "button_1.on_click(on_button_clicked_1)\n", - "create_0 = widgets.VBox([target_schema_2, key_2,transaction,statement, button_1, output_1])" + "create_0 = widgets.VBox([target_schema_2_combo, key_2_combo,transaction_combo,statement_combo, button_1, output_1])" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "id": "19e7defc-558f-455a-bc6e-4c6bc2cade65", "metadata": {}, "outputs": [], @@ -459,7 +450,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "f82c652f-0dca-48ce-a2f7-3c5eda71f3fe", "metadata": {}, "outputs": [], @@ -479,18 +470,19 @@ " reset_values(query_val = query_val, target_schema_val_2 = target_schema_val_2, key_val_2 = key_val_2)\n", "\n", "button.on_click(on_button_clicked_0)\n", - "create_1 = widgets.VBox([target_schema_2, key_2, query, button, output_0])\n" + "create_1 = widgets.VBox([target_schema_2_combo, key_2_combo, query, button, output_0])\n" ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "id": "947b5d38-5c30-4f77-87e9-7402e690ea06", "metadata": {}, "outputs": [], "source": [ "transaction_statement_list = widgets.Text(description = \"List of transaction IDs and statement IDs\", placeholder = \"[(trsansac_1, statemnt_1),(trsansac_2, statemnt_2)]\", layout=widgets.Layout(width='600px'))\n", "transaction_statement_list.style.description_width = '240px'\n", + "transaction_statement_list_combo = widgets.HBox([transaction_statement_list, create_tooltip(\"Enter the list of tuples of transaction and statements ids for the queries that you want to profile.\")])\n", "button_4 = widgets.Button(description=\"Get Query Plan\")\n", "output_4 = widgets.Output()\n", "transaction_statement_list_val = None\n", @@ -513,47 +505,78 @@ " target_schema_val_2 = target_schema_2.value\n", " key_val_2 = key_2.value\n", " transaction_statement_list_val = transaction_statement_list.value\n", + " transaction_statement_list_val.replace(\" \", \"\")\n", " logging.info(f\"[Query Profile Main Page] For create using multiple transaction ids and keys, saved key value as :{key_val_2}, target schema as {target_schema_val_2}, List of transactions and statements as {transaction_statement_list_val}.\")\n", " reset_values(transaction_statement_list_val = transaction_statement_list_val, target_schema_val_2 = target_schema_val_2, key_val_2 = key_val_2)\n", "\n", "button_4.on_click(on_button_clicked_4)\n", - "create_list_transaction_statement = widgets.VBox([target_schema_2, key_2,transaction_statement_list, button_4, output_4])" + "create_list_transaction_statement = widgets.VBox([target_schema_2_combo, key_2_combo,transaction_statement_list_combo, button_4, output_4])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fbb6fb85-5802-4786-a656-c98f1b5645eb", + "metadata": {}, + "outputs": [], + "source": [ + "tab_2 = widgets.Tab()\n", + "tab_2.children = [create_0, create_1, create_list_transaction_statement]\n", + "tab_2.titles = [\"Transaction & Statement\", \"From SQL\", \"Multiple Queries\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c7bf2f8f-d182-4190-af20-bc69e7e230fb", + "metadata": {}, + "outputs": [], + "source": [ + "# Vertical Border line\n", + "vertica_border_line = widgets.HTML(\"\"\"\n", + "\n", + "\n", + "\n", + "\n", + "
\n", + "\n", + "\n", + "\"\"\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9b66e217-7197-4d1c-b44c-a41ae53d51e9", + "metadata": {}, + "outputs": [], + "source": [ + "right_heading = widgets.HTML(\"\"\"

Profile from query

\"\"\")\n", + "right_section = widgets.VBox([right_heading,search_box, tab_2],layout= {\"margin\" :\"0px 0px 0px 50px\"})\n", + "left_section" ] }, { "cell_type": "markdown", - "id": "f5064472-4cd8-437c-8a4b-a9a01e3537c2", + "id": "394c1468-eb63-4638-8035-e3170a1265b0", "metadata": {}, "source": [ - "## Directly" + "__________" ] }, { "cell_type": "code", - "execution_count": 18, - "id": "fbb6fb85-5802-4786-a656-c98f1b5645eb", + "execution_count": null, + "id": "e18830ec-7208-4e69-858d-5aa19f2a7caa", "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "0d31b67802a8410db052ef89b033e970", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Tab(children=(VBox(children=(Text(value='', description='Target Schema (Optional)', layout=Layout(width='300px…" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ - "tab_2 = widgets.Tab()\n", - "tab_2.children = [create_0, create_1, create_list_transaction_statement]\n", - "tab_2.titles = [\"Transaction & Statement\", \"From SQL\", \"Multiple Queries\"]\n", - "display(tab_2)" + "right_section" ] }, { From 1bd0173af0b75afb1a54668ce551be07e9ff30a8 Mon Sep 17 00:00:00 2001 From: Umar Farooq Ghumman Date: Wed, 5 Jun 2024 09:39:01 -0500 Subject: [PATCH 2/2] Update qprof_main.ipynb --- project/ui/qprof_main.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/ui/qprof_main.ipynb b/project/ui/qprof_main.ipynb index 9da47dec..52ef3af3 100644 --- a/project/ui/qprof_main.ipynb +++ b/project/ui/qprof_main.ipynb @@ -660,7 +660,7 @@ "\n", "\n", "
\n", - " Page version update date: 6/3/2024\n", + " Page version update date: 6/5/2024\n", "
\n", "\n", ""