Skip to content

Commit a61bb98

Browse files
Add section for query stats viewer (timescale#2488)
* Add draft for query stats viewer * Add screenshot and table * Add admon * Update column descriptions * apparently ordinals have to be spelled out * update cache hit ratio description --------- Co-authored-by: Rajakavitha Kodhandapani <[email protected]>
1 parent e8b546f commit a61bb98

File tree

3 files changed

+70
-22
lines changed

3 files changed

+70
-22
lines changed

.vscode/image.code-snippets

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
{
2-
// Place your docs-timescale workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3-
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4-
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5-
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6-
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7-
// Placeholders with the same ids are connected.
8-
// Example:
9-
"Image": {
10-
"scope": "markdown,html",
11-
"prefix": ["img"],
12-
"body": [
13-
"<img class=\"main-content__illustration\"",
14-
"src=\"$1\"",
15-
"alt=\"$2\" />"
16-
],
17-
"description": "Inserts an image"
18-
}
19-
}
2+
// Place your docs-timescale workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3+
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4+
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5+
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6+
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7+
// Placeholders with the same ids are connected.
8+
// Example:
9+
"Image": {
10+
"scope": "markdown,html",
11+
"prefix": [
12+
"img"
13+
],
14+
"body": [
15+
"<img class=\"main-content__illustration\"",
16+
"src=\"$1\"",
17+
"width={1375} height={944}",
18+
"alt=\"$2\" />"
19+
],
20+
"description": "Inserts an image"
21+
}
22+
}

_partials/_early_access.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<Highlight type="important">
2-
This feature is early access. Early access features might be subject to billing changes in
3-
the future.
2+
This feature is early access. Early access features might be subject to billing
3+
changes in the future.
44
</Highlight>

use-timescale/metrics-logging/service-metrics.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@ cloud_ui:
99
- [services, :serviceId, metrics]
1010
---
1111

12+
import EarlyAccess from "versionContent/_partials/_early_access.mdx";
13+
1214
# Service metrics
1315

1416
You can view your service metrics from the Timescale
1517
[metrics dashboard][metrics-dashboard]. This dashboard gives you service-level
1618
information, such as CPU, memory, and storage usage.
1719

18-
You can also view your query-level statistics by using the pre-installed
20+
You can view query-level statistics from the `Query stats` tab. You can also
21+
view your query-level statistics by using the pre-installed
1922
[`pg_stat_statements`][pg-stat] extension from a PostgreSQL client.
2023

2124
## Metrics dashboard
2225

23-
Timescale provides a Metrics dashboard for managing your services. You can
26+
Timescale provides a metrics dashboard for managing your services. You can
2427
see the Metrics dashboard in your Timescale account by navigating to the
2528
`Services` section, clicking the service you want to explore, and selecting the
2629
`Metrics` tab.
@@ -89,6 +92,48 @@ increase your storage capacity, or reduce the size of your database. When you
8992
have done that, you can also add a retention policy, or turn on compression, to
9093
avoid the problem occurring again in the future.
9194

95+
## Query-level statistics in the Timescale dashboard
96+
97+
You can analyze your queries by navigating to the `Query stats` tab from the
98+
Services dashboard.
99+
100+
<EarlyAccess />
101+
102+
Use the filter at the top of the page to view details of your queries, including
103+
how many rows the query returned, and the time the query took to run.
104+
105+
<img class="main-content__illustration"
106+
src="https://s3.amazonaws.com/assets.timescale.com/docs/images/tsc_querystats_expanded.webp"
107+
width={1375} height={944}
108+
alt="The Timescale query stats viewer showing the statistics for a recent query" />
109+
110+
In the results window, use the horizontal scroll bar at the bottom of the screen
111+
to see statistics for your query. You can also use the arrow to the left of the
112+
query to expand it. The columns show these details about your queries:
113+
114+
|Column|Description|
115+
|-|-|
116+
|Executions|Number of times the query has been run during the results period|
117+
|Total rows|Total number of rows scanned, inserted, or updated by the query during the results period|
118+
|Median rows|Median number of rows touched each time the query is run|
119+
|P05 time|The fifth percentile, or the minimum time this query took|
120+
|Median time|Median number of microseconds (µs) or milliseconds (ms) it took to run the query|
121+
|P95 time|The ninety-fifth percentile, or the maximum time this query took|
122+
|Median memory|Median amount of memory consumed by the query
123+
|P95 memory|The ninety-fifth percentile, or the maximum memory this query used|
124+
|Median bytes read|Median number of bytes used each time the query is run|
125+
|P95 bytes read|The ninety-fifth percentile, or the maximum number of bytes this query used|
126+
|Cache hit ratio|Ratio of memory used compared to disk used, as a percentage. Calculated as `cache hit / (cache hit + cache miss)`.|
127+
|Hypertables|A green check mark is shown if results were drawn from a hypertable|
128+
|Compressed tables|A green check mark is shown if results were drawn from a compressed table|
129+
|User name|Username of the logged in user running the query|
130+
131+
<Highlight type="note">
132+
If you have just completed a query, it can take a minute or two for it to show
133+
in the query stats viewer. Wait a little, and then refresh the page to see your
134+
query.
135+
</Highlight>
136+
92137
## Query-level statistics with pg_stat_statements
93138

94139
The `pg_stat_statements` extension gives you query-level statistics for your SQL

0 commit comments

Comments
 (0)