Skip to content

Commit

Permalink
Merge pull request #292 from vertica/nocode_ui_pages_update_19
Browse files Browse the repository at this point in the history
tooltips for QueryProfiler Tree page
  • Loading branch information
mail4umar committed Sep 4, 2024
2 parents e9c6494 + 8ed2790 commit 10d8d44
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions project/ui/qprof-ui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,14 @@
"outputs": [],
"source": [
"display(HTML(html_code))\n",
"logging.info(f'[Query Profile Tree Page] Completed the script to automatically display the tree')"
"logging.info(f'[Query Profile Tree Page] Completed the script to automatically display the tree')\n",
"\n",
"def create_tooltip(text):\n",
" # Create an info icon using HTML\n",
" info_icon = widgets.HTML(\n",
" value=f'<span style=\"font-size: 25px; color: #007bff; cursor: pointer;\" title=\"{text}\">&#9432;</span>'\n",
" )\n",
" return info_icon"
]
},
{
Expand Down Expand Up @@ -531,7 +538,15 @@
" disabled=False\n",
")\n",
"granularity_level = 2\n",
"engine_table_granularity_switch_title = widgets.HTML('<b> Select granularity level:</b>')\n",
"engine_table_granularity_switch_title = widgets.HBox([widgets.HTML('<b> Select granularity level:</b>'), \n",
" create_tooltip(\"\"\"\n",
"The granularity level of the summary table. \n",
"Across paths: The summary table for each path. \n",
"Across nodes: The summary table for each node. All rows are summed and times are averaged\n",
"\"\"\"\n",
" )\n",
" ]\n",
")\n",
"def on_granularity_change(change):\n",
" if change['type'] == 'change' and change['name'] == 'value':\n",
" if change['new'] == 'Across nodes':\n",
Expand Down Expand Up @@ -634,15 +649,19 @@
" def summary_on_path_id_dropdown_change(change):\n",
" if not summary_node_name_dropdown.value == \"All\":\n",
" vdf=summary_vdf_main[summary_vdf_main[\"node_name\"]==summary_node_name_dropdown.value]\n",
" summary_localplan_id_dropdown.options = ['All'] + sorted(vdf[\"localplan_id\"].distinct())\n",
" summary_operator_name_dropdown.options = ['All'] + sorted(vdf[\"operator_name\"].distinct())\n",
" else:\n",
" vdf = summary_vdf_main\n",
" if change['type'] == 'change' and change['name'] == 'value':\n",
" selected_key = change['new']\n",
" if selected_key == 'All':\n",
" summary_localplan_id_dropdown.options = ['All'] + sorted(vdf[\"localplan_id\"].distinct())\n",
" summary_operator_name_dropdown.options = ['All'] + sorted(vdf[\"operator_name\"].distinct())\n",
" else: \n",
" vdf = vdf[vdf[\"path_id\"]==selected_key]\n",
" summary_localplan_id_dropdown.options = ['All'] + sorted(vdf[\"localplan_id\"].distinct())\n",
" summary_operator_name_dropdown.options = ['All'] + sorted(vdf[\"operator_name\"].distinct())\n",
" summary_localplan_id_dropdown.value = 'All'\n",
" if engine_table_granularity_switch.value == 'Across nodes':\n",
" display_vdf_across_nodes(path_id = selected_key)\n",
Expand All @@ -655,6 +674,7 @@
" def summary_on_localplan_id_dropdown_change(change):\n",
" if not summary_node_name_dropdown.value == \"All\":\n",
" vdf=summary_vdf_main[summary_vdf_main[\"node_name\"]==summary_node_name_dropdown.value]\n",
" summary_operator_name_dropdown.options = ['All'] + sorted(vdf[\"operator_name\"].distinct())\n",
" else:\n",
" vdf = summary_vdf_main\n",
" if not summary_path_id_dropdown.value == \"All\":\n",
Expand Down Expand Up @@ -682,7 +702,7 @@
" vdf = summary_vdf_main\n",
" if not summary_path_id_dropdown.value == \"All\":\n",
" vdf=vdf[vdf[\"path_id\"]==summary_path_id_dropdown.value]\n",
" if not summary_path_id_dropdown.value == \"All\":\n",
" if not summary_localplan_id_dropdown.value == \"All\":\n",
" vdf=vdf[vdf[\"localplan_id\"]==summary_localplan_id_dropdown.value]\n",
" if change['type'] == 'change' and change['name'] == 'value':\n",
" selected_key = change['new']\n",
Expand All @@ -691,7 +711,6 @@
" else:\n",
" display_vdf_across_paths(path_id=summary_path_id_dropdown.value)\n",
" detailed_update_table(node_name=summary_node_name_dropdown.value, path_id=summary_path_id_dropdown.value, localplan_id=summary_localplan_id_dropdown.value, operator_name=selected_key)\n",
" \n",
" summary_operator_name_dropdown.observe(summary_on_operator_name_dropdown_change, names='value') \n",
"\n",
" engine_table_granularity_title_switch = widgets.VBox([engine_table_granularity_switch_title, engine_table_granularity_switch], layout=widgets.Layout(padding='0 0 0 10px'))\n",
Expand All @@ -709,7 +728,14 @@
"\n",
"\n",
"# Tab for detailed Executio Engine Table\n",
"engine_table_detailed_selection_title = widgets.HTML('<b> Select detailed view:</b>')\n",
"engine_table_detailed_selection_title = widgets.HBox([widgets.HTML('<b> Select detailed view:</b>'), \n",
" create_tooltip(\"\"\"\n",
"Pivot Table: The detailed view of the query execution engine with selected metrics.\n",
"Raw Table: The raw table of the EXECUTION_ENGINE_PROFILES.\n",
"\"\"\"\n",
" )\n",
" ]\n",
")\n",
"engine_table_detailed_selection_switch = widgets.RadioButtons(\n",
" options=['Pivot Table', 'Raw Table'],\n",
" value='Pivot Table',\n",
Expand Down Expand Up @@ -1616,7 +1642,7 @@
"</head>\n",
"<body>\n",
" <div class=\"version\">\n",
" Page version update date: 8/28/2024\n",
" Page version update date: 9/3/2024\n",
" </div>\n",
"</body>\n",
"</html>"
Expand Down

0 comments on commit 10d8d44

Please sign in to comment.