How to visualize the query stats stored on "pghero_query_stats"
Closed this issue · 4 comments
Hi,
I have installed Pghero using Dockerization. I have two questions regarding it. Firstly, How to visualize the queries on the pghero's dashboard after creating the table pghero_query_stats, the historical query stats are stored in it over time. I am using another database to store these queries. The second thing is, What is the frequency of pghero hitting the request to the databases, and How can it be customized?
Hi @uahmadbayt,
- A time slider will show up at the top of the Query Stats page (example). You can also use a business intelligence tool to visualize the data.
- It hits the database on every request. This isn't customizable.
Hi Ankane,
Thank you for your response, but I cannot see a time slider on the Query Stats page. Is there any specific environment variable that needs to be declared in pghero.yml or the docker-compose.yml file?
Again for clarity, I want to mention that I want to see the queries that I archive in "pghero_query_stats" for Historical Query stat.
I've attached the screenshot for you to look over.
If you're storing stats in another database, you'll need to set PGHERO_STATS_DATABASE_URL
(docs).
I have successfully stored query statistics in the pghero_query_stats table using the command docker run -ti -e DATABASE_URL=... ankane/pghero bin/rake pghero:capture_query_stats. However, I'm trying to figure out how to display these stored queries on the PgHero dashboard. Could you guide me on how to achieve this?