Repository navigation
feat(stats): sparklines for connections and transactions or queries per second (#1165) - #1228
Merged
Merged
Conversation
…er second (#1165) The Overview polled the server every few seconds but showed only the current numbers. Each poll now also feeds an in-memory history (ten minutes of samples, kept while the Overview is open). Counters become rates per second from their change. PostgreSQL shows active connections and transactions per second; MySQL shows connected threads and queries per second. The sparklines come from the numbers each poll already fetched, so no query is added.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1165
What was wrong
The Overview polled the server every few seconds but showed only the current numbers, so a spike between two looks was invisible.
Changes
MetricHistory(core/stats/metric_history.dart): the last 120 samples per metric (ten minutes at the 5 s poll), kept in memory while the Overview is open. A counter's change between two samples becomes a rate per second; a counter that goes down (a restart) gives none.QueryaSparkline(shared/widgets/querya_sparkline.dart): a line of the samples; the tooltip names the latest value and its time; draws nothing until there are two samples.xact_commitacross databases), in the Connections card.Questions), in the Connections card.Not in this PR
Not verified locally
Tests were not run locally, per the project rule.