Skip to content

Commit

Permalink
Merge pull request #277 from vertica/nocode_ui_pages_update_09
Browse files Browse the repository at this point in the history
Updated GUI pages - QueryProfiler main page
  • Loading branch information
mail4umar authored Jul 8, 2024
2 parents e1bb834 + 55350ab commit 19f40a9
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions project/ui/qprof_main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
" }\n",
"</style>\n",
"<div class = \"custom_class_conn_info_header\">\n",
"<h3> Your connection details are as follows: </h3>\n",
"<h3> Your connection details: </h3>\n",
"</div>"
]
},
Expand Down Expand Up @@ -222,15 +222,11 @@
"def update_key_dropdown_options(change):\n",
" # Get the selected schema from the first dropdown\n",
" selected_schema = change.new\n",
" \n",
" # Query for the table names based on the selected schema\n",
" query = f\"SELECT DISTINCT table_name FROM tables WHERE table_name LIKE '%_dc_explain_plans_%' AND table_schema = '{selected_schema}' ORDER BY 1;\"\n",
" vdf = vp.vDataFrame(query)\n",
" \n",
" # Manipulate table names\n",
" length_to_remove = len(\"qprof_dc_explain_plans_\") + 1\n",
" vdf['table_name'] = vdf['table_name'].apply(f\"SUBSTR(table_name, {length_to_remove})\")\n",
" \n",
" # Query for the table names based on the selected schema\n",
" query = f\"SELECT SUBSTR(table_name, {length_to_remove}) AS 'table_name' FROM (SELECT DISTINCT table_name FROM tables WHERE table_name LIKE '%_dc_explain_plans_%' AND table_schema = '{selected_schema}') as foo order by 1;\"\n",
" vdf = vp.vDataFrame(query)\n",
" # Update options of the second dropdown\n",
" key_dropdown.options = [i[0] for i in vdf.to_list()]\n",
"\n",
Expand Down Expand Up @@ -425,7 +421,7 @@
"tab.titles = [\"From database\", \"From a file\"]\n",
"logging.info('[Query Profile Main Page] Trying to display the load tab')\n",
"logging.info('[Query Profile Main Page] Successfully loaded')\n",
"left_heading = widgets.HTML(\"\"\"<h1 style=\"text-align: left;\">Load from existing</h1>\"\"\")\n",
"left_heading = widgets.HTML(\"\"\"<h1 style=\"text-align: left;\">Load an existing QueryProfiler</h1>\"\"\")\n",
"left_section = widgets.VBox([left_heading,tab], layout= {\"margin\" :\"0px 0px 0px 50px\"})"
]
},
Expand All @@ -437,11 +433,12 @@
"outputs": [],
"source": [
"search_box_test = widgets.HTML(\"\"\"\n",
"You can query the ``query_requests`` table to search for the required query. You can use either:\n",
"You can query the 'QUERY_REQUESTS' table to search for the required query to get the transaction ID and statement ID needed to profile the query. You can use either:\n",
"<ul>\n",
"<li>Reqeuest label</li> \n",
"<li>Query part</li>\n",
"</ul>\n",
"For more information, please refer to the <a href=\"https://docs.vertica.com/24.2.x/en/sql-reference/system-tables/v-monitor-schema/query-requests/\" style=\"color: blue; text-decoration: underline;\">query_requests documentation</a>.\n",
"\"\"\")"
]
},
Expand All @@ -458,8 +455,12 @@
"query_search_check = widgets.Checkbox(value=False,description='Exact')\n",
"button_01 = widgets.Button(description=\"Query Request Table\", layout=widgets.Layout(width='auto'))\n",
"output_01 = widgets.Output()\n",
"request_label_widget = widgets.HBox([request_label_input, request_label_check])\n",
"query_search_widget = widgets.HBox([query_search_input, query_search_check])\n",
"request_label_widget = widgets.HBox([request_label_input, \n",
" create_tooltip(\"Labels are inserted inside the query in order to track them. If you have labeled your queries, you can conveniently serach them from their labels.\"), \n",
" request_label_check])\n",
"query_search_widget = widgets.HBox([query_search_input, \n",
" create_tooltip(\"Enter the exact Query to search or part of it.\"),\n",
" 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",
"\n",
Expand Down Expand Up @@ -676,7 +677,7 @@
"metadata": {},
"outputs": [],
"source": [
"right_heading = widgets.HTML(\"\"\"<h1 style=\"text-align: left;\">Profile from query</h1>\"\"\")\n",
"right_heading = widgets.HTML(\"\"\"<h1 style=\"text-align: left;\">Create a new QueryProfiler</h1>\"\"\")\n",
"right_section = widgets.VBox([right_heading,search_box, tab_2],layout= {\"margin\" :\"0px 0px 0px 50px\"})\n",
"left_section"
]
Expand Down Expand Up @@ -780,7 +781,7 @@
"</head>\n",
"<body>\n",
" <div class=\"version\">\n",
" Page version update date: 6/24/2024\n",
" Page version update date: 7/5/2024\n",
" </div>\n",
"</body>\n",
"</html>"
Expand Down

0 comments on commit 19f40a9

Please sign in to comment.