Skip to content

Commit

Permalink
sql: record total transaction time
Browse files Browse the repository at this point in the history
This commit adds the collection of a few things about the transactions
(namely, average transaction time, whether it was committed, and whether
it was implicit). This information is stored in a virtual in-memory table.

Additionally, p90 and p99 of per-application average transaction time are
displayed as two new dashboards on SQL metrics page.

Release note (admin ui change): metrics about p90 and p99 percentiles of
per-application average transaction time are now exposed in the UI.
  • Loading branch information
yuzefovich committed Aug 27, 2019
1 parent 4395846 commit ee48ea7
Show file tree
Hide file tree
Showing 25 changed files with 817 additions and 321 deletions.
1 change: 1 addition & 0 deletions docs/generated/settings/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
<tr><td><code>sql.metrics.statement_details.plan_collection.enabled</code></td><td>boolean</td><td><code>true</code></td><td>periodically save a logical plan for each fingerprint</td></tr>
<tr><td><code>sql.metrics.statement_details.plan_collection.period</code></td><td>duration</td><td><code>5m0s</code></td><td>the time until a new logical plan is collected</td></tr>
<tr><td><code>sql.metrics.statement_details.threshold</code></td><td>duration</td><td><code>0s</code></td><td>minimum execution time to cause statistics to be collected</td></tr>
<tr><td><code>sql.metrics.transaction_details.enabled</code></td><td>boolean</td><td><code>true</code></td><td>collect per-application transaction statistics</td></tr>
<tr><td><code>sql.parallel_scans.enabled</code></td><td>boolean</td><td><code>true</code></td><td>parallelizes scanning different ranges when the maximum result size can be deduced</td></tr>
<tr><td><code>sql.query_cache.enabled</code></td><td>boolean</td><td><code>true</code></td><td>enable the query cache</td></tr>
<tr><td><code>sql.stats.automatic_collection.enabled</code></td><td>boolean</td><td><code>true</code></td><td>automatic statistics collection mode</td></tr>
Expand Down
3 changes: 2 additions & 1 deletion pkg/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2139,12 +2139,13 @@ writing ` + os.DevNull + `
debug/nodes/1/crdb_internal.gossip_network.txt
debug/nodes/1/crdb_internal.gossip_nodes.txt
debug/nodes/1/crdb_internal.leases.txt
debug/nodes/1/crdb_internal.node_statement_statistics.txt
debug/nodes/1/crdb_internal.node_build_info.txt
debug/nodes/1/crdb_internal.node_metrics.txt
debug/nodes/1/crdb_internal.node_queries.txt
debug/nodes/1/crdb_internal.node_runtime_info.txt
debug/nodes/1/crdb_internal.node_sessions.txt
debug/nodes/1/crdb_internal.node_statement_statistics.txt
debug/nodes/1/crdb_internal.node_txn_stats.txt
debug/nodes/1/details.json
debug/nodes/1/gossip.json
debug/nodes/1/enginestats.json
Expand Down
3 changes: 2 additions & 1 deletion pkg/cli/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ var debugZipTablesPerNode = []string{

"crdb_internal.leases",

"crdb_internal.node_statement_statistics",
"crdb_internal.node_build_info",
"crdb_internal.node_metrics",
"crdb_internal.node_queries",
"crdb_internal.node_runtime_info",
"crdb_internal.node_sessions",
"crdb_internal.node_statement_statistics",
"crdb_internal.node_txn_stats",
}

type zipper struct {
Expand Down
Loading

0 comments on commit ee48ea7

Please sign in to comment.