The query-metric tool includes subcommands that facilitate creating data queries for listing metrics, server instances, and dimension values. This tool runs in both interactive and non-interactive modes. Queries are formed using the following subcommands:

Creates a series of hyper-linked HTML files for a broad range of metrics. The tool generates these files by making a series of API queries for a set of servers and metrics. The tool highlights the breadth of available metrics and patterns or anomalies across multiple metrics. In interactive mode, the tool prompts for the servers and the metrics.
Defines a query for specific data of interest. In interactive mode, the tool prompts for the server, metrics, dimensions, statistics, and pivot values. The tool can be used to request a data formatted in .xml, .json, or .csv.

query-metric tool commands

To start the tool in interactive mode, enter the following command:

$ query-metric

Or, specify a subcommand in interactive mode:

$ query-metric explore

In non-interactive mode, the tool generates a data table based on command-line input. For example, the following command requests information from the local PingDataMetrics server listening on port 8080 and generates response-time and throughput data tables for Proxy server instances in Austin for the previous two weeks:

$ query-metric explore \
  --httpPort 8080 \
  --instanceType proxy \
  --instanceLocation Austin \
  --metric response-time \
  --metric throughput \
  --startTime -2w

The following command line obtains a JSON formatted data table that shows average throughput for all PingDirectoryProxy server instances, over time with 100 data points. Each line in the table represents either an application's search or modification throughput. Throughput values are represented as operations per second:

$ query-metric query \
  --hostname localhost \
  --httpPort 8080 \
  --username cn=user1,cn=api-users \
  --password secret \
  --table json \
  --metric throughput \
  --instanceType proxy \
  --statistic average \
  --pivot op-type \
  --pivot application-name \
  --dimension op-type:search,modify \
  --rateScaling second \
  --maxIntervals 100 \
  --startTime 2012-09-01T17:41Z \
  --endTime 2012-09-30T17:41Z

To see a list of all supported options, run the help option for the query-metric tool:

$ query-metric -?