Queries the metrics of application monitoring by page.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes QueryMetricByPage

The operation that you want to perform. Set the value to QueryMetricByPage.

EndTime Long Yes 1596183532000

The end of the time range to query. Unit: milliseconds.

IntervalInSec Integer Yes 60000

The time interval between the data shards to be queried. Unit: milliseconds. Minimum value: 60000.

Measures.N RepeatList Yes youngGcCount The metrics that you want to query. For more information, see the Application monitoring metrics that can be queried section in this topic. You can specify a maximum of five metrics.
Metric String Yes appstat.vm The metric set that you want to query. You cannot specify custom metric sets. For more information, see the Application monitoring metrics that can be queried section in this topic.
StartTime Long Yes 1595319532000

The beginning of the time range to query. Unit: milliseconds.

OrderBy String No rpc

The dimension from which metrics are sorted. You can set this parameter to a supported dimension.

Filters.N.Key String Yes pid The keys of the filter conditions for the query. The pid and regionId filter conditions required. For more information about how to obtain the process identifier (PID) of an application, see Obtain the PID of an application.
Filters.N.Value String Yes atc889zkcf@d8deedfa9****** The values of the filter conditions for the query. The pid and regionId filter conditions are required. For more information about how to obtain the PID of an application, see Obtain the PID of an application.
Dimensions.N RepeatList No pid The dimension from which metrics are to be queried. For more information, see the Application monitoring metrics that can be queried section in this topic. You can specify a maximum of five dimensions.
Order String No ASC

The order in which metrics are sorted. Valid values:

  • ASC: ascending order
  • DESC: descending order
RegionId String No cn-hangzhou

The ID of the region.

CurrentPage Integer No 1

Optional. The number of the page to return. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page.

Obtain the PID of an application

Log on to the Application Real-Time Monitoring Service (ARMS) console. In the left-side navigation pane, choose Application Monitoring > Applications. In the top navigation bar, select the region where your application resides. On the Applications page, click the name of the application. The application overview page appears.

The URL in the browser address bar contains the PID of this application in the format of pid=xxx. Data is encoded in the browser. Therefore, you must modify the obtained PID of an application except for one in Enterprise Distributed Application Service (EDAS). For example, if the PID in the URL is xxx%4074xxx, you must replace %40 with the at sign (@). The actual PID is xxx@74xxx.

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code returned for the request. Valid values:

  • 2XX: The request is successful.
  • 3XX: A redirection message is returned.
  • 4XX: The request is invalid.
  • 5XX: A server error occurs.
Data Struct

The struct returned.

Items List []

The list of data entries returned.

Page Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

Total Integer 0

The total number of entries returned.

Message String StartTime is mandatory for this action.

The message that is returned if a request parameter is invalid.

RequestId String 626037F5-FDEB-45B0-804C-B3C92797****

The ID of the request.

Success Boolean true

Indicates whether the call is successful. Valid values:

  • true: The call is successful.
  • false: The call fails.

Application monitoring metrics that can be queried

You can call the QueryMetricByPage operation to query the following application monitoring metrics.

Note
  • You must set the pid and regionId filter conditions in the filters parameter.
  • If you have obtained the PID and region ID of your application, add the values to the filters parameter to filter data. If you have not obtained the PID or region ID, specify one or more dimensions provided in the following table for the dimensions parameter to filter data.
Metric set Description Dimension Metric
appstat.vm A collection of common metrics that are shown in the Java virtual machine (JVM) monitoring chart on the application details page. These metrics are related to garbage collections (GCs), heap memory, non-heap memory, and threads.
  • pid
  • rootIp
GCs:
  • youngGcCount: the number of GCs in the young generation
  • oldGcCount: the number of full heap GCs (Full GCs)
  • youngGcTime: the amount of time consumed to monitor GCs in the young generation
  • oldGcTime: the amount of time consumed to monitor Full GCs
  • youngGcCountInstant: the instantaneous value of the number of GCs in the young generation
  • oldGcCountInstant: the instantaneous value of the number of Full GCs
  • youngGcTimeInstant: the instantaneous value of the amount of time consumed to monitor GCs in the young generation
  • oldGcTimeInstant: the instantaneous value of the amount of time consumed to monitor Full GCs
Heap memory and non-heap memory:
  • EdenSpace: the eden space in the young generation
  • OldGen: the old generation
  • survivorSpace: the survivor space in the young generation
  • metaSpace
  • nonHeapCommitted: the non-heap memory
  • nonHeapInit: the initial value of the non-heap memory
  • nonHeapMax: the maximum value of the non-heap memory
  • nonHeapUsed: the usage of the non-heap memory
  • directUsed: the amount of used direct buffer in the off-heap memory
  • directCapacity: the total amount of direct buffer in the off-heap memory
Threads:
  • threadCount: the total number of threads
  • threadNewCount: the number of new threads
  • threadDeadlockCount: the number of deadlocked threads in the JVM
  • threadRunnableCount: the number of runnable threads in the JVM
  • threadTerminatedCount: the number of terminated threads
  • threadTimedWaitCount: the number of threads in the timed_waiting state
  • threadWaitCount: the number of threads in the waiting state
  • threadBlockedCount: the number of blocked threads
appstat.host A collection of metrics for host monitoring. These metrics are related to instances, CPU, physical memory, disk, load, network traffic, and network packets.
  • pid
  • rootIp
Instances:
  • instanceCount: the number of instances
CPU:
  • systemCpuIdle: the percentage of idle CPU in the last 5 seconds, which is not displayed in the ARMS console
  • systemCpuSystem: the percentage of CPU occupied by the system in the last 5 seconds
  • systemCpuUser: the percentage of CPU occupied by users in the last 5 seconds
  • systemCpuIoWait: the percentage of CPU consumed for I/O waiting in the last 5 seconds
Physical memory:
  • systemMemFree: the amount of free memory
  • systemMemUsed: the amount of used memory
  • systemMemTotal: the total amount of memory, which is not displayed in the ARMS console
  • systemMemBuffers: the amount of memory in the buffer cache
  • systemMemCached: the amount of memory in the page cache
Disk:
  • systemDiskFree: the size of free disk space in bytes
  • systemDiskUsedRatio: the usage of the disk space
  • SystemDiskTotal: the total size of disk space in bytes, which is not displayed in the ARMS console
Load:
  • systemLoad
Network:
  • systemNetInPackets: the average number of packets received over the network per second in the last 30 seconds
  • systemNetOutPackets: the average number of packets sent over the network per second in the last 30 seconds
  • systemNetInErrs: the average number of frame errors that occur over the network per second in the last 30 seconds
  • systemNetOutErrs: the average number of errors sent over the network per second in the last 30 seconds
  • systemNetInBytes: the average number of bytes received over the network per second in the last 30 seconds
  • systemNetOutBytes: the average number of bytes sent over the network per second in the last 30 seconds
appstat.database A collection of metrics for database calls.
  • pid
  • rpcType: the type of the call
  • endpoint: the endpoint of the database, which is localhost: 3306
  • destId: the name of the database, which is arms
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
  • resultsize: This metric is available only when MySQL 5.X is used.
appstat.txn A collection of metrics related to API calls.
  • pid
  • rpcType
  • rpc: the /demo/oracleTwo operation
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
  • errCount: the error rate
appstat.incall A collection of metrics related to application details.
  • pid
  • rpcType
  • rootIp
  • rpc
  • ppid
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
appstat.exception A collection of metrics related to exceptions.
  • pid
  • rpc
  • endpoint
  • excepType
  • excepInfo
  • rt: the response time
  • count: the number of requests
appstat.sql A collection of metrics related to slow SQL queries.
  • pid
  • rpc
  • endpoint
  • sqlId
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
  • slow
  • resultsize: This metric is available only when MySQL 5.X is used.
Note If the value of the slow metric is true, the filter conditions do not take effect.
appstat.mq.send A collection of metrics related to message sending by using Message Queue N/A
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
appstat.mq.receive A collection of metrics related to message receiving by using Message Queue N/A
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
appstat.schedulerx A collection of metrics related to SchedulerX calls.
  • pid
  • rpcType
  • rootIp
  • rpc
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
  • delay: the latency in scheduling
appstat.elasticsearch A collection of metrics related to Elasticsearch calls.
  • pid
  • rpc
  • endpoint
  • opType: the type of the operation, such as index and search operations. This dimension is supported only when elasticsearch-rest-high-level-client is used.
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
  • requestsize: the size of the request
  • responsesize: the size of the response, which is available only for synchronous calls
appstat.redis A collection of metrics related to ApsaraDB for Redis (Redis) calls.
  • pid
  • rpcType
  • endpoint
  • opType
  • rpc
  • rt: the response time
  • count: the number of requests
  • error: the number of errors
  • hitrate: the hit rate, which is available only when Jedis is used
  • resultsize: This metric is available only when Jedis is used.

Examples

Sample requests

http(s)://[Endpoint]/?Action=QueryMetricByPage
&EndTime=1596183532000
&IntervalInSec=60000
&Measures.1=youngGcCount
&Metric=appstat.vm
&StartTime=1595319532000
&<Common request parameters>

Sample success responses

XML format

<QueryMetricByPageResponse>
      <RequestId>626037F5-FDEB-45B0-804C-B3C92797****</RequestId>
      <Data>
            <PageSize>10</PageSize>
            <Total>0</Total>
            <Page>1</Page>
            <Items>[]</Items>
      </Data>
      <Code>200</Code>
      <Success>true</Success>
</QueryMetricByPageResponse>

JSON format

{
    "RequestId": "626037F5-FDEB-45B0-804C-B3C92797****",
    "Data": {
        "PageSize": 10,
        "Total": 0,
        "Page": 1,
        "Items": "[]"
    },
    "Code": 200,
    "Success": true
}