Skip to content

Commit

Permalink
QueryProfiler UI Page - Updated checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
mail4umar committed Aug 28, 2024
1 parent 980e308 commit f455f0e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions project/ui/qprof-ui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,13 @@
"\n",
"# Create checkboxes\n",
"checkboxes = [\n",
" widgets.Checkbox(value=(tag in [\"exec_time_us\", \"prod_rows\", \"clock_time_us\", \"rle_prod_rows\", \"mem_all_b\"]), description=tag) \n",
" widgets.Checkbox(value=(tag in [\"exec_time_us\", \"prod_rows\", \"proc_rows\", \"clock_time_us\", \"mem_all_b\"]), description=tag) \n",
" for tag in tags\n",
"]\n",
"selected_checkboxes = []\n",
"selected_checkboxes = [cb.description for cb in checkboxes if cb.value]\n",
"# Function to update based on selections\n",
"def on_checkbox_change(change):\n",
" global selected_checkboxes, summary_vdf, granularity_level, granularity_column_list\n",
" global selected_checkboxes, summary_vdf, summary_vdf_main, granularity_level, granularity_column_list\n",
" selected_checkboxes = [cb.description for cb in checkboxes if cb.value]\n",
" if len(selected_checkboxes) > 6:\n",
" # Deselect the latest selection if limit is exceeded\n",
Expand All @@ -522,12 +522,14 @@
"\n",
"# Selecting the granularity of the summary table\n",
"granularity_level = 0\n",
"granularity_column_list = [\"node_name\", \"path_id\", \"localplan_id\", \"operator_name\", \"thread_count\"]\n",
"engine_table_granularity_switch = widgets.RadioButtons(\n",
" options=['Pivot Table of metrics', 'Summary across nodes', 'Summary across steps'],\n",
" value='Pivot Table of metrics', # Defaults to 'Pivot Table of metrics'\n",
" # description='Select Granularity Level:',\n",
" disabled=False\n",
")\n",
"\n",
"engine_table_granularity_switch_title = widgets.HTML('<b> Select granularity level:</b>')\n",
"def on_granularity_change(change):\n",
" global granularity_level, summary_vdf, summary_vdf_main, granularity_column_list\n",
Expand Down Expand Up @@ -753,10 +755,13 @@
"engine_table_button = widgets.Button(description = \"Fetch data\", layout=widgets.Layout(margin='10px 0 10px 0'))\n",
"def on_engine_table_button_click(b):\n",
" engine_table_button.disabled = True\n",
" global summary_vdf, summary_vdf_main, engine_tab_summary_1\n",
" global summary_vdf, summary_vdf_main, engine_tab_summary_1, granularity_column_list, granularity_level\n",
" \n",
" try:\n",
" summary_vdf_main = qprof._get_vdf_summary()[0][\"node_name\", \"path_id\", \"localplan_id\", \"operator_name\", \"exec_time_us\", \"est_rows\", \"rle_prod_rows\"]\n",
" summary_vdf_main = qprof._get_vdf_summary()[0][\"node_name\", \"path_id\", \"localplan_id\", \"operator_name\", \"exec_time_us\", \"prod_rows\", \"proc_rows\", \"clock_time_us\", \"mem_all_b\"] # TO FIX LIST\n",
" # column_list = granularity_column_list\n",
" # column_list.extend(selected_checkboxes)\n",
" # summary_vdf_main = qprof._get_vdf_summary()[granularity_level][column_list]\n",
" summary_vdf = summary_vdf_main\n",
" # Update dropdowns\n",
" summary_node_name_dropdown.options = ['All'] + sorted(summary_vdf[\"node_name\"].distinct())\n",
Expand Down

0 comments on commit f455f0e

Please sign in to comment.