-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Synthetixio/time-queries
Measure query performance
- Loading branch information
Showing
4 changed files
with
264 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import streamlit as st | ||
|
||
from api.internal_api import SynthetixAPI, get_db_config | ||
from dashboards.utils import performance | ||
|
||
st.markdown("# Query Performance") | ||
|
||
if "df_query" not in st.session_state: | ||
st.session_state.df_query = None | ||
|
||
|
||
def time_queries(): | ||
results = performance.run_benchmarks(st.session_state.api) | ||
|
||
# create dataframe | ||
df = performance.create_benchmark_dataframe(results) | ||
st.session_state.df_query = df | ||
|
||
|
||
st.button("Run queries", on_click=time_queries) | ||
|
||
if st.session_state.df_query is not None: | ||
st.dataframe(st.session_state.df_query) |
Oops, something went wrong.