Estimated Reading Time: 3 minutes|Last Updated: 11/3/2021, 10:50:40 AM

# Application Metrics

# Get application metrics: CPU

# Description

Get application metrics: CPU

# URI

GET /api/agents/[agent_id]/application/[application_id]/cpu

Please refer to Applications to see how to obtain application_id.

# URI parameter

  • _timestamp_gt

    type: integer

    required: no

    description: the starting unix timestamp of the data, in seconds.

  • _pagesize

    type: integer

    required: no

    description: number of data points.

  • time_interval

    type: string

    required: no

    description: time interval of data points, the minimum is one minute.

    The format is [number]+[unit], such as 1+minute, 15+minute, 30+minute, 1+hour, 3+hour.

# Example Request

# Shell

curl \
 -H "API-Token: efa45ec2de7dfc34271aabbbbdd7266b"
 "https://{console-host}/api/agents/1/applications/1/cpu?_pagesize=10000&_timestamp_gt=1623163723&time_interval=2+hour"

# Example Response

Status: 200 OK
{
    "status": 0,
    "data": [
        {
            "kind": "master process", // process type
            "percent": 0,
            "pid": 436,
            "timestamp": 1623251638
        },
        {
            "kind": "worker process",
            "percent": 0,
            "pid": 437,
            "timestamp": 1623251638
        },
        {
            "kind": "master process",
            "percent": 0,
            "pid": 436,
            "timestamp": 1623251637
        },
        {
            "kind": "worker process",
            "percent": 0,
            "pid": 437,
            "timestamp": 1623251637
        },
        {
            "kind": "master process",
            "percent": 0,
            "pid": 436,
            "timestamp": 1623251636
        }
    ]
}

# Get application metrics: memory

# Description

Get application metrics: memory

# URI

GET /api/agents/[agent_id]/application/[application_id]/memory

# URI parameter

  • _timestamp_gt

    type: integer

    required: no

    description: the starting unix timestamp of the data, in seconds.

  • _pagesize

    type: integer

    required: no

    description: number of data points.

  • time_interval

    type: string

    required: no

    description: time interval of data points, the minimum is one minute.

    The format is [number]+[unit], such as 1+minute, 15+minute, 30+minute, 1+hour, 3+hour.

# Example Request

# Shell

curl \
 -H "API-Token: efa45ec2de7dfc34271aabbbbdd7266b"
 "https://{console-host}/api/agents/1/applications/1/memory?_pagesize=10000&_timestamp_gt=1623163723&time_interval=2+hour"

# Example Response

Status: 200 OK
{
    "status": 0,
    "data": [
        {
            "pid": 436,
            "kind": "master process",
            "resident": 2256896, // resident memory, unit: Byte
            "timestamp": 1623251755
        },
        {
            "pid": 437,
            "kind": "worker process",
            "resident": 3366912,
            "timestamp": 1623251755
        },
        {
            "pid": 436,
            "kind": "master process",
            "resident": 2256896,
            "timestamp": 1623251754
        },
        {
            "pid": 437,
            "kind": "worker process",
            "resident": 3366912,
            "timestamp": 1623251754
        },
        {
            "pid": 436,
            "kind": "master process",
            "resident": 2256896,
            "timestamp": 1623251753
        }
    ]
}

# Get application metrics: disk

# Description

Get application metrics: disk

# URI

GET /api/agents/[agent_id]/application/[application_id]/disk

# URI parameter

  • _timestamp_gt

    type: integer

    required: no

    description: the starting unix timestamp of the data, in seconds.

  • _pagesize

    type: integer

    required: no

    description: number of data points.

  • time_interval

    type: string

    required: no

    description: time interval of data points, the minimum is one minute.

    The format is [number]+[unit], such as 1+minute, 15+minute, 30+minute, 1+hour, 3+hour.

# Example Request

# Shell

curl \
 -H "API-Token: efa45ec2de7dfc34271aabbbbdd7266b"
 "https://{console-host}/api/agents/1/applications/1/disk?_pagesize=10000&_timestamp_gt=1623163723&time_interval=2+hour"

# Example Response

Status: 200 OK
{
    "status": 0,
    "data": [
        {
            "rchar": 0,
            "wchar": 0,
            "syscr": 0,
            "syscw": 0,
            "read_bytes": 0,
            "write_bytes": 0,
            "cancelled_write_bytes": 0,
            "timestamp": 1623251850,
            "pid": 436,
            "kind": "master process"
        },
        {
            "rchar": 0,
            "wchar": 0,
            "syscr": 0,
            "syscw": 0,
            "read_bytes": 0,
            "write_bytes": 0,
            "cancelled_write_bytes": 0,
            "timestamp": 1623251850,
            "pid": 437,
            "kind": "worker process"
        },
        {
            "rchar": 0,
            "wchar": 0,
            "syscr": 0,
            "syscw": 0,
            "read_bytes": 0,
            "write_bytes": 0,
            "cancelled_write_bytes": 0,
            "timestamp": 1623251848,
            "pid": 436,
            "kind": "master process"
        },
        {
            "rchar": 0,
            "wchar": 0,
            "syscr": 0,
            "syscw": 0,
            "read_bytes": 0,
            "write_bytes": 0,
            "cancelled_write_bytes": 0,
            "timestamp": 1623251848,
            "pid": 437,
            "kind": "worker process"
        },
        {
            "rchar": 0,
            "wchar": 0,
            "syscr": 0,
            "syscw": 0,
            "read_bytes": 0,
            "write_bytes": 0,
            "cancelled_write_bytes": 0,
            "timestamp": 1623251847,
            "pid": 436,
            "kind": "master process"
        }
    ]
}