Skip to content

Commit 39f08dc

Browse files
New CLI examples for RDS Performance Insights (#9473)
1 parent 1df4005 commit 39f08dc

12 files changed

+299
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
**To create a performance analysis report**
2+
3+
The following ``create-performance-analysis-report`` example creates a performance analysis report with the start time ``1682969503`` and end time ``1682979503`` for the database ``db-abcdefg123456789``. ::
4+
5+
aws pi create-performance-analysis-report \
6+
--service-type RDS \
7+
--identifier db-abcdefg123456789 \
8+
--start-time 1682969503 \
9+
--end-time 1682979503
10+
11+
Output::
12+
13+
{
14+
"AnalysisReportId": "report-0234d3ed98e28fb17"
15+
}
16+
17+
For more information about creating performance analysis reports, see `Creating a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.CreatingPerfAnlysisReport.html>`__ in the *Amazon RDS User Guide* and `Creating a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.CreatingPerfAnlysisReport.html>`__ in the *Amazon Aurora User Guide*.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**To delete a performance analysis report**
2+
3+
The following ``delete-performance-analysis-report`` example deletes the performance analysis report with the report ID ``report-0d99cc91c4422ee61``. ::
4+
5+
aws pi delete-performance-analysis-report \
6+
--service-type RDS \
7+
--identifier db-abcdefg123456789 \
8+
--analysis-report-id report-0d99cc91c4422ee61
9+
10+
This command produces no output.
11+
12+
For more information about deleting performance analysis reports, see `Deleting a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.DeletePerfAnalysisReport.html>`__ in the *Amazon RDS User Guide* and `Deleting a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.DeletePerfAnalysisReport.html>`__ in the *Amazon Aurora User Guide*.

awscli/examples/pi/describe-dimension-keys.rst

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**To describe dimension keys**
1+
**Example 1: To describe dimension keys**
22

33
This example requests the names of all wait events. The data is summarized by event name, and the aggregate values of those events over the specified time period.
44

@@ -54,3 +54,35 @@ Output::
5454
}
5555
]
5656
}
57+
58+
**Example 2: To find the SQL ID for statements contributing the most to DB load**
59+
60+
The following ``describe-dimension-keys`` requests the SQL statement and SQL ID for the 10 statements that contributed the most to DB load. ::
61+
62+
aws pi describe-dimension-keys \
63+
--service-type RDS \
64+
--identifier db-abcdefg123456789 \
65+
--start-time 2023-05-01T00:00:00Z \
66+
--end-time 2023-05-01T01:00:00Z \
67+
--metric db.load.avg \
68+
--group-by '{"Group": "db.sql", "Dimensions": ["db.sql.id", "db.sql.statement"],"Limit": 10}'
69+
70+
Output::
71+
72+
{
73+
"AlignedEndTime": 1.5270804E9,
74+
"AlignedStartTime": 1.5270264E9,
75+
"Identifier": "db-abcdefg123456789",
76+
"MetricList": [
77+
{
78+
"Keys": [
79+
{
80+
"Dimensions": {"db.sql.id": "AKIAIOSFODNN7EXAMPLE", "db.sql.statement": "SELECT * FROM customers WHERE customer_id = 123"},
81+
"Total": 25.5,"Partitions": [12.3, 13.2]
82+
}
83+
]
84+
}
85+
]
86+
}
87+
88+
For more information about dimensions in Performance Insights, see `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon RDS User Guide* and `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon Aurora User Guide*.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**To get details for a specified dimension group for a DB instance**
2+
3+
The following ``get-dimension-key-details`` example retrieves the full text of a SQL statement for DB instance ``db-10BCD2EFGHIJ3KL4M5NO6PQRS5``. The ``--group`` is ``db.sql``, and the ``--group-identifier`` is ``db.sql.id``. In this example, ``example-sql-id`` represents a SQL ID retrieved by using the ``get-resource-metrics`` or ``describe-dimension-keys`` operations. In this example, the dimensions details are available. Thus, Performance Insights retrieves the full text of the SQL statement, without truncating it. ::
4+
5+
aws pi get-dimension-key-details \
6+
--service-type RDS \
7+
--identifier db-10BCD2EFGHIJ3KL4M5NO6PQRS5 \
8+
--group db.sql \
9+
--group-identifier example-sql-id \
10+
--requested-dimensions statement
11+
12+
Output::
13+
14+
{
15+
"Dimensions":[
16+
{
17+
"Value": "SELECT e.last_name, d.department_name FROM employees e, departments d WHERE e.department_id=d.department_id",
18+
"Dimension": "db.sql.statement",
19+
"Status": "AVAILABLE"
20+
},
21+
...
22+
]
23+
}
24+
25+
For more information about dimensions in Performance Insights, see `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon RDS User Guide* and `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon Aurora User Guide*.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
**To get a performance analysis report**
2+
3+
The following ``get-performance-analysis-report`` example gets the performance analysis report for the database ``db-abcdefg123456789`` with the report ID ``report-0d99cc91c4422ee61``. The response provides the report status, ID, time details, and insights. ::
4+
5+
aws pi get-performance-analysis-report \
6+
--service-type RDS \
7+
--identifier db-abcdefg123456789 \
8+
--analysis-report-id report-0d99cc91c4422ee61
9+
10+
Output::
11+
12+
{
13+
"AnalysisReport": {
14+
"Status": "Succeeded",
15+
"ServiceType": "RDS",
16+
"Identifier": "db-abcdefg123456789",
17+
"StartTime": 1680583486.584,
18+
"AnalysisReportId": "report-0d99cc91c4422ee61",
19+
"EndTime": 1680587086.584,
20+
"CreateTime": 1680587087.139,
21+
"Insights": [
22+
... (Condensed for space)
23+
]
24+
}
25+
}
26+
27+
For more information about performance analysis reports, see `Analyzing database performance for a period of time <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.AnalyzePerformanceTimePeriod.html>`__ in the *Amazon RDS User Guide* and `Analyzing database performance for a period of time <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.AnalyzePerformanceTimePeriod.html>`__ in the *Amazon Aurora User Guide*.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
**To get resource metadata for a database**
2+
3+
The following ``get-resource-metadata`` example gets the resource metadata for the database ``db-abcdefg123456789``. The response shows that SQL digest statistics are enabled. ::
4+
5+
aws pi get-resource-metadata \
6+
--service-type RDS \
7+
--identifier db-abcdefg123456789
8+
9+
Output::
10+
11+
{
12+
"Identifier": "db-abcdefg123456789",
13+
"Features":{
14+
"SQL_DIGEST_STATISTICS":{
15+
"Status": "ENABLED"
16+
}
17+
}
18+
}
19+
20+
For more information about SQL statistics for Performance Insights, see `SQL statistics for Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/sql-statistics.html>`__ in the *Amazon RDS User Guide* and `SQL statistics for Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/sql-statistics.html>`__ in the *Amazon Aurora User Guide*.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
**To list the dimensions that can be queried for a metric type on a DB instance**
2+
3+
The following ``list-available-resource-dimensions`` example lists the ``db.load`` metrics you can query for the database ``db-abcdefg123456789``. ::
4+
5+
aws pi list-available-resource-dimensions \
6+
--service-type RDS \
7+
--identifier db-abcdefg123456789 \
8+
--metrics db.load
9+
10+
Output::
11+
12+
{
13+
"MetricDimensions": [
14+
{
15+
"Metric": "db.load",
16+
"Groups": [
17+
{
18+
"Group": "db.user",
19+
"Dimensions": [
20+
{
21+
"Identifier": "db.user.id"
22+
},
23+
{
24+
"Identifier": "db.user.name"
25+
}
26+
]
27+
},
28+
{
29+
"Group": "db.sql_tokenized",
30+
"Dimensions": [
31+
{
32+
"Identifier": "db.sql_tokenized.id"
33+
},
34+
{
35+
"Identifier": "db.sql_tokenized.db_id"
36+
},
37+
{
38+
"Identifier": "db.sql_tokenized.statement"
39+
}
40+
]
41+
},
42+
...
43+
]
44+
}
45+
]
46+
}
47+
48+
For more information about dimensions in Performance Insights, see `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon RDS User Guide* and `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon Aurora User Guide*.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
**To list the metrics that can be queried for a metric type on a DB instance**
2+
3+
The following ``list-available-resource-metrics`` example lists the ``db.load`` metrics you can query for the database ``db-abcdefg123456789``. ::
4+
5+
aws pi list-available-resource-metrics \
6+
--service-type RDS \
7+
--identifier db-abcdefg123456789 \
8+
--metric-types "os" "db"
9+
10+
Output::
11+
12+
{
13+
"Metrics": [
14+
{
15+
"Description": "The number of virtual CPUs for the DB instance",
16+
"Metric": "os.general.numVCPUs",
17+
"Unit": "vCPUs"
18+
},
19+
......,
20+
{
21+
"Description": "Time spent reading data file blocks by backends in this instance",
22+
"Metric": "db.IO.read_latency",
23+
"Unit": "Milliseconds per block"
24+
},
25+
......
26+
]
27+
}
28+
29+
For more information about metrics in Performance Insights, see `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon RDS User Guide* and `Database load <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.Overview.ActiveSessions.html>`__ in the *Amazon Aurora User Guide*.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
**To list performance analysis reports for a database**
2+
3+
The following ``list-performance-analysis-reports`` example lists performance analysis reports for the database ``db-abcdefg123456789``. The response lists all the reports with the report ID, status, and time period details. ::
4+
5+
aws pi list-performance-analysis-reports \
6+
--service-type RDS \
7+
--identifier db-abcdefg123456789
8+
9+
Output::
10+
11+
{
12+
"AnalysisReports": [
13+
{
14+
"Status": "Succeeded",
15+
"EndTime": 1680587086.584,
16+
"CreateTime": 1680587087.139,
17+
"StartTime": 1680583486.584,
18+
"AnalysisReportId": "report-0d99cc91c4422ee61"
19+
},
20+
{
21+
"Status": "Succeeded",
22+
"EndTime": 1681491137.914,
23+
"CreateTime": 1681491145.973,
24+
"StartTime": 1681487537.914,
25+
"AnalysisReportId": "report-002633115cc002233"
26+
},
27+
{
28+
"Status": "Succeeded",
29+
"EndTime": 1681493499.849,
30+
"CreateTime": 1681493507.762,
31+
"StartTime": 1681489899.849,
32+
"AnalysisReportId": "report-043b1e006b47246f9"
33+
},
34+
{
35+
"Status": "InProgress",
36+
"EndTime": 1682979503.0,
37+
"CreateTime": 1682979618.994,
38+
"StartTime": 1682969503.0,
39+
"AnalysisReportId": "report-01ad15f9b88bcbd56"
40+
}
41+
]
42+
}
43+
44+
For more information about performance analysis reports, see `Analyzing database performance for a period of time <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.AnalyzePerformanceTimePeriod.html>`__ in the *Amazon RDS User Guide* and `Analyzing database performance for a period of time <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.AnalyzePerformanceTimePeriod.html>`__ in the *Amazon Aurora User Guide*.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
**To list tags for a performance analysis report**
2+
3+
The following ``list-tags-for-resource`` example lists tags for a performance analysis report with the report ID ``report-0d99cc91c4422ee61``. ::
4+
5+
aws pi list-tags-for-resource \
6+
--service-type RDS \
7+
--resource-arn arn:aws:pi:us-west-2:123456789012:perf-reports/RDS/db-abcdefg123456789/report-0d99cc91c4422ee61
8+
9+
Output::
10+
11+
{
12+
"Tags": [
13+
{
14+
"Value": "test-tag",
15+
"Key": "name"
16+
}
17+
]
18+
}
19+
20+
For more information about tagging performance analysis reports, see `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon RDS User Guide* and `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon Aurora User Guide*.

awscli/examples/pi/tag-resource.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**To add a tag to a performance analysis report**
2+
3+
The following ``tag-resource`` example adds the tag key ``name`` with the tag value ``test-tag`` to a performance analysis report with the report ID ``report-0d99cc91c4422ee61``. ::
4+
5+
aws pi tag-resource \
6+
--service-type RDS \
7+
--resource-arn arn:aws:pi:us-west-2:123456789012:perf-reports/RDS/db-abcdefg123456789/report-0d99cc91c4422ee61 \
8+
--tags Key=name,Value=test-tag
9+
10+
This command produces no output.
11+
12+
For more information about tagging performance analysis reports, see `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon RDS User Guide* and `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon Aurora User Guide*.

awscli/examples/pi/untag-resource.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**To delete a tag for a performance analysis report**
2+
3+
The following ``untag-resource`` example deletes the tag ``name`` for a performance analysis report with the report ID ``report-0d99cc91c4422ee61``. ::
4+
5+
aws pi untag-resource \
6+
--service-type RDS \
7+
--resource-arn arn:aws:pi:us-west-2:123456789012:perf-reports/RDS/db-abcdefg123456789/report-0d99cc91c4422ee61 \
8+
--tag-keys name
9+
10+
This command produces no output.
11+
12+
For more information about tagging performance analysis reports, see `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon RDS User Guide* and `Adding tags to a performance analysis report in Performance Insights <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.html>`__ in the *Amazon Aurora User Guide*.

0 commit comments

Comments
 (0)