Skip to content

Commit

Permalink
Merge pull request #264 from vertica/query_profiler_tree_page_update_02
Browse files Browse the repository at this point in the history
Added plot tab
  • Loading branch information
oualib authored May 28, 2024
2 parents b47d007 + 7319066 commit e13d573
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions project/ui/qprof-ui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"import ipywidgets as widgets\n",
"from datetime import datetime\n",
"import verticapy as vp\n",
"import plotly.graph_objects as go\n",
"from verticapy.performance.vertica import QueryProfilerInterface, QueryProfiler\n",
"logging.info('[Query Profile Tree Page] Successfully Imported Libraries ')\n",
"output_initial = widgets.Output()\n",
Expand Down Expand Up @@ -134,15 +135,6 @@
"source": [
"# Loading display settings\n",
"with output_initial:\n",
" # Initialize variables with default values\n",
" # count_widget_val = None\n",
" # footer_widget_val = None\n",
" # comma_widget_val = None\n",
" # percent_bar_widget_val = None\n",
" # max_cell_width_widget_val = None\n",
" # max_columns_widget_val = None\n",
" # max_rows_widget_val = None\n",
"\n",
" # Attempt to load stored variables\n",
" try:\n",
" %store -r count_widget_val\n",
Expand Down Expand Up @@ -422,6 +414,27 @@
" transactions_table = widgets.VBox([widgets.HTML(f\"<p style='color:red'>The following error occured: </p> <p> {e}</p>\")])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "88d01b31-5b2a-4ed1-95e7-5452e3e86183",
"metadata": {},
"outputs": [],
"source": [
"# Plots\n",
"# query_execution_steps_widget = qprof.get_qsteps()\n",
"query_plan_profile = qprof.get_qplan_profile()\n",
"query_plan_profile_plot = go.FigureWidget(data=[query_plan_profile.data[i] for i in range(len(query_plan_profile.data))],)\n",
"\n",
"query_execution = qprof.get_qexecution()\n",
"query_execution_plot = go.FigureWidget(data=[query_execution.data[i] for i in range(len(query_execution.data))],)\n",
"\n",
"plot_tabs = widgets.Tab()\n",
"\n",
"plot_tabs.children = [query_plan_profile_plot, query_execution_plot]\n",
"plot_tabs.titles = [\"Query Plan Profile\", \"Query Execution Plot\"]\n"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -441,9 +454,9 @@
"child_1 = widgets.VBox([output_tree])\n",
"child_2 = widgets.VBox([transactions_table])\n",
"child_3 = widgets.VBox([tables])\n",
"\n",
"tabs.children = [child_1, child_2, child_3]\n",
"tabs.titles = [\"Tree\", \"Transaction List\", \"Other info\"]\n",
"child_4 = widgets.VBox([plot_tabs])\n",
"tabs.children = [child_1, child_2, child_3, child_4]\n",
"tabs.titles = [\"Tree\", \"Transaction List\", \"Other info\", \"Plots\"]\n",
"display(tabs)"
]
},
Expand Down

0 comments on commit e13d573

Please sign in to comment.