Navigation

mongocli ops-manager metrics databases describe

The metrics databases describe command gets the measurements of the specified database for an Ops Manager process.

You can get the processes associated with a particular Ops Manager project with the process list command.

mongocli ops-manager|om metrics databases describe <process-id> <db-name>
--granularity <time-interval>
--period <time-period>
--start <start-time>
--end <end-time>
[ --type <type-of-measurement> ]
[ --limit <number-of-items-per-page> ]
[ --output|-o <output-format> ]
[ --page <page-number> ]
[ --profile|-P <profile-name> ]
[ --projectId <id-of-project> ]
Note

Use -h or --help to view the command-line help for this command.

Option
Type
Description
Required?
<process-id>
String
The unique identifier of the Ops Manager process that contains the database to describe.
yes
<db-name>
String
Name of the database to describe.
yes
--granularity
String

An ISO 8601-formatted time period that specifies the interval between measurement data points. For example, PT1M specifies 1-minute granularity.

The following subset of ISO 8601-formatted time periods are supported:

  • PT1M
  • PT5M
  • PT1H
  • P1D

When you specify granularity, you must specify either period or start and end.

yes
--period
String
An ISO 8601-formatted time period that specifies the length of time in the past to query. For example, to request the last 36 hours, specify: --period P1DT12H. Mutually exclusive with start and end.
yes
--start
String
The time at which to start retrieving metrics, as specified by an ISO 8601 timestamp string. If you specify start you must also specify end. Mutually exclusive with period.
yes
--end
String
The time at which to stop retrieving metrics, as specified by an ISO 8601 timestamp string. If you specify end you must also specify start. Mutually exclusive with period.
yes
--type
String

Specifies which measurement to return. If type is not specified, all metrics are returned.

You must specify metrics that are valid for the host. Ops Manager returns an error if any specified metrics are invalid.

The following measurement values are valid:

  • DATABASE_AVERAGE_OBJECT_SIZE
  • DATABASE_COLLECTION_COUNT
  • DATABASE_DATA_SIZE
  • DATABASE_FILE_SIZE
  • DATABASE_STORAGE_SIZE
  • DATABASE_INDEX_SIZE
  • DATABASE_INDEX_COUNT
  • DATABASE_EXTENT_COUNT
  • DATABASE_OBJECT_COUNT
no
--limit
integer
Number of items per page, up to a maximum of 500. Defaults to 100 if omitted.
no
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format
  • go-template for custom output using the Go template
  • go-template-file for custom output specified using the Go template file

If omitted, the command returns output in the default format.

no
--page
integer
Page number (1-based). Defaults to 1 if not specified.
no
--profile, -P
string
Name of the profile where the public and private keys for the project are saved. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI.
no
--projectId
string

Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable.

no

The command prints the following fields in the specified format to the terminal if the command succeeds. If the command prints an error, see Troubleshooting for recommended solutions.

NAME UNITS TIMESTAMP VALUE
DATABASE_AVERAGE_OBJECT_SIZE BYTES 2020-10-07T14:24:20Z 212
DATABASE_AVERAGE_OBJECT_SIZE BYTES 2020-10-07T14:39:20Z 212
DATABASE_AVERAGE_OBJECT_SIZE BYTES 2020-10-07T14:59:20Z 212
DATABASE_COLLECTION_COUNT SCALAR 2020-10-07T14:24:20Z 3
DATABASE_COLLECTION_COUNT SCALAR 2020-10-07T14:39:20Z 3
DATABASE_COLLECTION_COUNT SCALAR 2020-10-07T14:59:20Z 3
DATABASE_DATA_SIZE BYTES 2020-10-07T14:24:20Z 1060
DATABASE_DATA_SIZE BYTES 2020-10-07T14:39:20Z 1060
DATABASE_DATA_SIZE BYTES 2020-10-07T14:59:20Z 1060
DATABASE_STORAGE_SIZE BYTES 2020-10-07T14:24:20Z 98304
DATABASE_STORAGE_SIZE BYTES 2020-10-07T14:39:20Z 98304
DATABASE_STORAGE_SIZE BYTES 2020-10-07T14:59:20Z 98304
DATABASE_INDEX_SIZE BYTES 2020-10-07T14:24:20Z 102400
DATABASE_INDEX_SIZE BYTES 2020-10-07T14:39:20Z 102400
DATABASE_INDEX_SIZE BYTES 2020-10-07T14:59:20Z 102400
DATABASE_INDEX_COUNT SCALAR 2020-10-07T14:24:20Z 4
DATABASE_INDEX_COUNT SCALAR 2020-10-07T14:39:20Z 4
DATABASE_INDEX_COUNT SCALAR 2020-10-07T14:59:20Z 4
DATABASE_EXTENT_COUNT SCALAR 2020-10-07T14:24:20Z 0
DATABASE_EXTENT_COUNT SCALAR 2020-10-07T14:39:20Z 0
DATABASE_EXTENT_COUNT SCALAR 2020-10-07T14:59:20Z 0
DATABASE_OBJECT_COUNT SCALAR 2020-10-07T14:24:20Z 5
DATABASE_OBJECT_COUNT SCALAR 2020-10-07T14:39:20Z 5
DATABASE_OBJECT_COUNT SCALAR 2020-10-07T14:59:20Z 5
DATABASE_VIEW_COUNT SCALAR 2020-10-07T14:24:20Z 0
DATABASE_VIEW_COUNT SCALAR 2020-10-07T14:39:20Z 0
DATABASE_VIEW_COUNT SCALAR 2020-10-07T14:59:20Z 0

The following example uses the mongocli om metrics databases describe command to retrieve the DATABASE_INDEX_SIZE for the database sample_db, running on Ops Manager process 5392aa974e4cf52044128aa684fe98b8. It uses the default profile for accessing Ops Manager and specifying a project.

mongocli om metrics database describe 5392aa974e4cf52044128aa684fe98b8 sample_db --granularity PT5M --period PT1H --type DATABASE_INDEX_SIZE -o json

The command prints the following fields to the terminal in JSON format. To learn more about these fields, see Output.

{
"end": "2020-10-07T15:19:20Z",
"granularity": "PT5M",
"groupId": "f39ffc90735f2201990f5381",
"hostId": "5392aa974e4cf52044128aa684fe98b8",
"links": [
{
"rel": "self",
"href": "..."
},
{
"rel": "http://mms.mongodb.com/host",
"href": "..."
},
{
"rel": "http://mms.mongodb.com/group",
"href": "..."
}
],
"measurements": [
{
"dataPoints": [
{
"timestamp": "2020-10-07T14:39:20Z",
"value": 102400
},
{
"timestamp": "2020-10-07T14:59:20Z",
"value": 102400
},
{
"timestamp": "2020-10-07T15:19:20Z",
"value": 102400
}
],
"name": "DATABASE_INDEX_SIZE",
"units": "BYTES"
}
],
"processId": "db1.example.com:27017",
"start": "2020-10-07T14:39:20Z",
"databaseName": "sample_db"
}
Give Feedback