Skip to content

Commit c67c1d8

Browse files
authored
DOCSP-12386: Created performanceAdvisor slowQueryLogs pages (#296)
* (DOCSP-12386): Created performanceAdvisor slowQueryLogs pages for Atlas, Cloud Manager, and Ops Manager in the MongoCLI space * (DOCSP-12386): Deleted extra spaces * (DOCSP-12386): Fixed references * (DOCSP-12386): Added space for reference syntax * (DOCSP-12386): updated references * (DOCSP-12386: removing settings.json) * (DOCSP-12386): fixed variables
1 parent 3cce3e8 commit c67c1d8

File tree

6 files changed

+512
-0
lines changed

6 files changed

+512
-0
lines changed

source/reference/atlas/performanceadvisor-commands.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ Atlas ``performanceAdvisor`` Commands
1010
:titlesonly:
1111

1212
List Namespaces for a Host </reference/atlas/performanceadvisor-namespaces-list>
13+
14+
Get Slow Queries </reference/atlas/performanceadvisor-slowQueryLogs>
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
.. _mcli-atlas-performanceadvisor-slowQueryLogs-cmd:
2+
3+
=================================================
4+
mongocli atlas performanceAdvisor slowQueryLogs
5+
=================================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
.. include:: /includes/styles/corrections.rst
16+
17+
The ``performanceAdvisor slowQueryLogs`` command
18+
retrieves a list of log lines for slow queries. You can also analyze slow queries through the |service| :atlas:`UI </analyze-slow-queries/>` or :atlas:`API </reference/api/pa-get-slow-query-logs/>`.
19+
20+
Syntax
21+
------
22+
23+
.. code-block:: text
24+
25+
mongocli atlas performanceadvisor slowQueryLog|s ls
26+
--processName <host-name>
27+
[ --since <unix-epoch-timestamp> ]
28+
[ --duration <milliseconds> ]
29+
[ --nLogs <max-log-lines> ]
30+
[ --namespace <namespaces> ]
31+
[ --projectId <project-ID> ]
32+
33+
.. include:: /includes/fact-command-line-help.rst
34+
35+
.. _atlas-performanceadvisor-slowQueryLogs-options:
36+
37+
Options
38+
-------
39+
40+
.. list-table::
41+
:widths: 20 10 60 10
42+
:header-rows: 1
43+
44+
* - Option
45+
- Type
46+
- Description
47+
- Required?
48+
49+
* - ``--processName``
50+
- string
51+
- The unique identifier of the host of a MongoDB process in the
52+
following format: ``{hostname}:{port}``.
53+
- yes
54+
55+
* - ``--since``
56+
- integer
57+
- Point in time, specified as a |epoch-time-ms|, from which you
58+
want to retrieve results.
59+
- no
60+
61+
* - ``--duration``
62+
- string
63+
- Length of time from the ``since`` parameter, in milliseconds,
64+
for which you want to retrieve results.
65+
- no
66+
67+
* - ``--nLogs``
68+
- integer
69+
- Maximum number of log lines to return. Defaults to 20000.
70+
- no
71+
72+
* - ``--namespace``
73+
- string
74+
- Namespace from which to retrieve slow query logs. A namespace consists of the database and collection resource separated by a ``.``, such as ``<database>.<collection>``.
75+
- no
76+
77+
* - ``--projectId``
78+
- string
79+
- Unique identifier of the project that contains the host
80+
for which you want to retrieve slow-running queries. If omitted, uses the project ID in the profile or :ref:`environment variable
81+
<mcli-env-var>`.
82+
- no
83+
84+
.. note::
85+
86+
If ``since`` is indicated and ``duration`` is omitted, the response contains results from the since point up to the present time.
87+
88+
If ``duration`` is indicated and ``since`` is omitted, the response contains results from duration ms ago through the present time.
89+
90+
If both ``since`` and ``duration`` are omitted, the response contains results from the previous 24 hours up through the present time.
91+
92+
.. _atlas-performanceadvisor-slowQueryLogs-output:
93+
94+
Output
95+
------
96+
97+
If the command succeeds, it returns the following output in the default
98+
format. If the command returns errors, see
99+
:ref:`Troubleshooting <troubleshooting>` for recommended solutions.
100+
101+
.. code-block:: sh
102+
:copyable: false
103+
104+
NAMESPACE LINE
105+
<database>.<collection> log line
106+
107+
.. include:: /includes/fact-default-output.rst
108+
109+
- :atlas:`Atlas API </reference/api/pa-get-slow-query-logs/>`
110+
111+
Example
112+
-------
113+
114+
.. tabs::
115+
116+
.. tab:: Default Output
117+
:tabid: default-output
118+
119+
The following command retrieves the namespaces for collections
120+
experiencing slow queries for a project using the
121+
{+default-profile+}, which contains credentials to access the
122+
project and the project ID. The output is returned in the default
123+
format.
124+
125+
.. code-block:: sh
126+
127+
mongocli atlas performanceAdvisor slowQueryLogs ls --processName atlas-111ggi-shard-00-00.111xx.mongodb.net:27017
128+
129+
The previous command prints the following to the terminal.
130+
131+
.. code-block:: sh
132+
:copyable: false
133+
134+
NAMESPACE LINE
135+
myDB.users "2018-08-16T22:53:43.447+0000 I COMMAND [conn10614] command myDb.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"832b4b0e-085a-480e-b470-16a0994dc7cb\") }, $clusterTime: { clusterTime: Timestamp(1534460016, 1)..."
136+
myDB.users "2018-08-16T22:54:32.705+0000 I COMMAND [conn10614] command myDb.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"832b4b0e-085a-480e-b470-16a0994dc7cb\") }, $clusterTime: { clusterTime: Timestamp(1534460056, 1), ..."
137+
138+
.. tab:: JSON Output
139+
:tabid: json-output
140+
141+
The following command retrieves the namespaces for collections
142+
experiencing slow queries for a project using the
143+
{+default-profile+}, which contains credentials to access the
144+
project and the project ID. The output is returned in |json|
145+
format.
146+
147+
.. code-block:: sh
148+
149+
mongocli atlas performanceAdvisor slowQueryLogs ls --processName atlas-111ggi-shard-00-00.111xx.mongodb.net:27017 --output json
150+
151+
The previous command prints the following to the terminal in
152+
|json| format.
153+
154+
.. code-block:: json
155+
:copyable: false
156+
157+
{
158+
"slowQueries": [
159+
{
160+
"line" : "2018-08-16T22:53:43.447+0000 I COMMAND [conn10614] command myDb.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"832b4b0e-085a-480e-b470-16a0994dc7cb\") }, $clusterTime: { clusterTime: Timestamp(1534460016, 1)...",
161+
"namespace": "myDB.users"
162+
},
163+
{
164+
"line": "2018-08-16T22:54:32.705+0000 I COMMAND [conn10614] command myDb.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"832b4b0e-085a-480e-b470-16a0994dc7cb\") }, $clusterTime: { clusterTime: Timestamp(1534460056, 1), ...",
165+
"namespace": "myDB.users"
166+
}
167+
]
168+
}

source/reference/cloud-manager/performanceadvisor-commands.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ Cloud Manager ``performanceAdvisor`` Commands
1010
:titlesonly:
1111

1212
List Namespaces for a Host </reference/cloud-manager/performanceadvisor-namespaces-list>
13+
14+
Get Slow Queries </reference/cloud-manager/performanceadvisor-slowQueryLogs>
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
.. _mcli-cm-performanceadvisor-slowQueryLogs-cmd:
2+
3+
=======================================================
4+
mongocli cloud-manager performanceAdvisor slowQueryLogs
5+
=======================================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
.. include:: /includes/styles/corrections.rst
16+
17+
The ``performanceAdvisor slowQueryLogs`` command
18+
retrieves a list of log lines for slow queries. You can also analyze slow queries through the |cloud-short| :cloudmgr:`UI</analyze-slow-queries/>` or :cloudmgr:`API</reference/api/performance-advisor-get-slow-queries/>`.
19+
20+
Syntax
21+
------
22+
23+
.. code-block:: text
24+
25+
mongocli cloud-manager|cm performanceadvisor slowQueryLog|s ls
26+
--hostId <host-name>
27+
[ --since <unix-epoch-timestamp> ]
28+
[ --duration <milliseconds> ]
29+
[ --nLogs <max-log-lines> ]
30+
[ --namespace <namespaces> ]
31+
[ --projectId <project-ID> ]
32+
33+
.. include:: /includes/fact-command-line-help.rst
34+
35+
.. _cm-performanceadvisor-slowQueryLogs-options:
36+
37+
Options
38+
-------
39+
40+
.. list-table::
41+
:widths: 20 10 60 10
42+
:header-rows: 1
43+
44+
* - Option
45+
- Type
46+
- Description
47+
- Required?
48+
49+
* - ``--hostId``
50+
- string
51+
- The unique identifier of the host of a MongoDB process. Use the
52+
``process list`` :ref:`command <mcli-cm-process-list-cmd>` to retrieve your ``hostId``.
53+
- yes
54+
55+
* - ``--since``
56+
- integer
57+
- Point in time, specified as a |epoch-time-ms|, from which you
58+
want to retrieve results.
59+
- no
60+
61+
* - ``--duration``
62+
- string
63+
- Length of time from the ``since`` parameter, in milliseconds,
64+
for which you want to retrieve results.
65+
- no
66+
67+
* - ``--nLogs``
68+
- integer
69+
- Maximum number of log lines to return. Defaults to 20000.
70+
- no
71+
72+
* - ``--namespace``
73+
- string
74+
- Namespace from which to retrieve slow query logs. A namespace
75+
consists of the database and collection resource separated by a ``.``, such as ``<database>.<collection>``.
76+
- no
77+
78+
* - ``--projectId``
79+
- string
80+
- Unique identifier of the project that contains the host
81+
for which you want to retrieve slow-running queries. If omitted, uses the project ID in the profile or :ref:`environment variable
82+
<mcli-env-var>`.
83+
- no
84+
85+
.. note::
86+
87+
If ``since`` is indicated and ``duration`` is omitted, the response contains results from the since point up to the present time.
88+
89+
If ``duration`` is indicated and ``since`` is omitted, the response contains results from duration ms ago through the present time.
90+
91+
If both ``since`` and ``duration`` are omitted, the response contains results from the previous 24 hours up through the present time.
92+
93+
.. _cm-performanceadvisor-slowQueryLogs-output:
94+
95+
Output
96+
------
97+
98+
If the command succeeds, it returns the following output in the default
99+
format. If the command returns errors, see
100+
:ref:`Troubleshooting <troubleshooting>` for recommended solutions.
101+
102+
.. code-block:: sh
103+
:copyable: false
104+
105+
NAMESPACE LINE
106+
<database>.<collection> log line
107+
108+
.. include:: /includes/fact-default-output.rst
109+
110+
- :cloudmgr:`Cloud Manager API </reference/api/performance-advisor-get-slow-queries/>`
111+
112+
Example
113+
-------
114+
115+
.. tabs::
116+
117+
.. tab:: Default Output
118+
:tabid: default-output
119+
120+
The following command retrieves the namespaces for collections
121+
experiencing slow queries for a project using the
122+
{+default-profile+}, which contains credentials to access the
123+
project and the project ID. The output is returned in the default
124+
format.
125+
126+
.. code-block:: sh
127+
128+
mongocli cm performanceAdvisor slowQueryLogs ls --hostId 78b0e5ae329f98047bddeac69ab40bc5
129+
130+
The previous command prints the following to the terminal.
131+
132+
.. code-block:: sh
133+
:copyable: false
134+
135+
NAMESPACE LINE
136+
myDB.users "2018-08-16T22:53:43.447+0000 I COMMAND [conn10614] command myDb.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"832b4b0e-085a-480e-b470-16a0994dc7cb\") }, $clusterTime: { clusterTime: Timestamp(1534460016, 1)..."
137+
myDB.users "2018-08-16T22:54:32.705+0000 I COMMAND [conn10614] command myDb.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"832b4b0e-085a-480e-b470-16a0994dc7cb\") }, $clusterTime: { clusterTime: Timestamp(1534460056, 1), ..."
138+
139+
.. tab:: JSON Output
140+
:tabid: json-output
141+
142+
The following command retrieves the namespaces for collections
143+
experiencing slow queries for a project using the
144+
{+default-profile+}, which contains credentials to access the
145+
project and the project ID. The output is returned in |json|
146+
format.
147+
148+
.. code-block:: sh
149+
150+
mongocli cm performanceAdvisor slowQueryLogs ls --hostId 78b0e5ae329f98047bddeac69ab40bc5 --output json
151+
152+
The previous command prints the following to the terminal in
153+
|json| format.
154+
155+
.. code-block:: json
156+
:copyable: false
157+
158+
{
159+
"slowQueries": [
160+
{
161+
"line" : "2018-08-16T22:53:43.447+0000 I COMMAND [conn10614] command myDb.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"832b4b0e-085a-480e-b470-16a0994dc7cb\") }, $clusterTime: { clusterTime: Timestamp(1534460016, 1)...",
162+
"namespace": "myDB.users"
163+
},
164+
{
165+
"line": "2018-08-16T22:54:32.705+0000 I COMMAND [conn10614] command myDb.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"832b4b0e-085a-480e-b470-16a0994dc7cb\") }, $clusterTime: { clusterTime: Timestamp(1534460056, 1), ...",
166+
"namespace": "myDB.users"
167+
}
168+
]
169+
}

source/reference/ops-manager/performanceadvisor-commands.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ Ops Manager ``performanceAdvisor`` Commands
1010
:titlesonly:
1111

1212
List Namespaces for a Host </reference/ops-manager/performanceadvisor-namespaces-list>
13+
14+
Get Slow Queries </reference/ops-manager/performanceadvisor-slowQueryLogs>

0 commit comments

Comments
 (0)