forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: restructure sqlstats public writer API
Previously, SQL Stats's public writer interface is was very limited in its functionality. This was intentional back in the time where SQL Stat's writer was injected into the stats collector and directly wrote statistics into the in-memory store. However, as we move to support grouping statement statistics within an explicit transaction, we need to create short-lived emphemeral sqlstats.Writer to record statement statistics for explicit transactions, then merge the stored statistics inside the emphemeral sqlstats.Writer into the main SQLStats. However, this merge cannot be implemented with the current sqlstats.Writer API, since the API does not allow statistics to be fetched from the sqlstats.Writer. This commit restructures the SQL Stats Writer API to introduce the concept of sqlstats.ApplicationStats, which is backed by the ssmemstorage.Container struct. Now, sqlstats.Storage interface would return the new sqlstats.ApplicationStats intead of sqlstats.Writer to the connExecutor, which can be injected into the sqlstats.StatsCollector. This is the initial step to address cockroachdb#59205 Release justification: Low risk, high benefit changes to existing functionality Release note: None
- Loading branch information
Showing
11 changed files
with
113 additions
and
82 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
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
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
Oops, something went wrong.