You need to enable JavaScript to run this app.
导航

GetAppExceptionalCPUTrend

最近更新时间2024.04.25 18:49:51

首次发布时间2024.04.25 18:49:51

调用GetAppExceptionalCPUTrend获取CPU异常的趋势。

请求说明

  • 请求方式:POST
  • 请求地址:?Action=GetAppExceptionalCPUTrend&Version=2024-04-09

ServiceName : apmplus_openapi
Region : cn-beijing
X-App-Ids : xxx
Content-Type : application/json

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

GetAppExceptionalCPUTrend

接口名称。当前 API 的名称为 GetAppExceptionalCPUTrend

Version

String

2024-04-09

接口版本。当前 API 的版本为 2024-04-09

Body

参数

类型

是否必选

示例值

描述

start_time

Integer

1665417600

查询起始时间(Unix时间戳)。

end_time

Integer

1665504000

查询结束时间(Unix时间戳)。

filters

Object of Condition

-

筛选条件,可以指定多个键值对来筛选数据。

granularity

Integer

15

聚合粒度,单位为分钟。

group_by_field

String

os_version

分组字段名。

metric

String

crash_count

指标名称。

  • crash_count:异常数
  • crash_ratio:异常率
  • crash_user:影响用户数
  • crash_user_ratio_avg:平均影响用户比
  • crash_user_ratio:整体影响用户比
  • cpu_report_cnt_per_launch:单次启动平均上报次数
  • avg_process_cpu_rate:平均进程CPU使用率
  • avg_process_cpu_speed_rate:平均进程CPU使用速率

is_new

Integer

1

是否新增issue。

  • 1:只看新增issue
  • 0:全部issue

token

String

OutOfMemory

搜索关键词。

status

Array of String

["pending"]

处理状态。

  • pending:未修复
  • processing:修复中
  • ignored:已忽略
  • solved:已修复
  • reopen:重复出现

tags

Array of Long

[111, 222]

自定义标签筛选。

managers

Array of Long

[123456789]

按责任人筛选,传用户ID列表。

Condition

参数

类型

是否必选

示例值

描述

op

String

in

操作符。

  • gt:大于
  • gte:大于等于
  • lt:小于
  • lte:小于等于
  • eq:等于
  • neq:不等于
  • in:包含
  • not_in:不包含
  • lk:like
  • nlk:not like
  • regex:正则匹配
  • not_null:非正则匹配

type

String

expression

筛选条件类型。

  • expression:当前condition是一个表达式
  • and:当前condition是一个复合表达式,多个sub_condition的逻辑关系是and
  • or:当前condition是一个复合表达式,多个sub_condition的逻辑关系是or
  • map:当前condition是map类型

value

String

123456

筛选值。

values

Array of String

[123456]

筛选值,支持多个。

map_key

String

key_1

map类型key,当type为map时必填。

dimension

String

aid

条件的名称。

sub_conditions

Array of Condition

-

子条件。

返回参数

参数

类型

示例值

描述

data

Array of TrendLine

-

不分组的请求下,list只有一个元素,分组情况下会有多个元素,每个元素代表一条线。

error_msg

String

-

错误信息。

error_no

Integer

0

错误码。

TrendLine

参数

类型

示例值

描述

name

String

count

线的名称,在分组的情况下,name应该是分组维度的取值,比如用来显示曲线的图标。

points

Array of TrendPoint

-

曲线上的点。

TrendPoint

参数

类型

示例值

描述

value

Double

0.5

指标值。

timestamp

Long

1619827200

指标发生时间(Unix时间戳)。

readable_timestamp

String

2021-04-01T00:00:00Z

指标发生时间(自然时间)。

请求示例

POST ?Action=GetAppExceptionalCPUTrend&Version=2024-04-09
{
    "start_time": 1665417600,
    "end_time": 1665504000,
    "filters": {
        "type": "and",
        "sub_conditions": [
            {
                "dimension": "apm_version",
                "type": "expression",
                "op": "in",
                "values": [
                    "1.4.5"
                ]
            },
            {
                "dimension": "device_model",
                "type": "expression",
                "op": "in",
                "values": [
                    "MI 5X"
                ]
            }
        ]
    },
    "granularity": 15,
    "group_by_field": "os_version",
    "metric": "crash_count",
    "is_new": 1,
    "token": "OutOfMemory",
    "status": [
        "pending"
    ],
    "tags": [
        111,
        222
    ],
    "managers": [
        123456789
    ]
}

返回示例

{
    "data": [
        {
            "name": "count",
            "points": [
                {
                    "value": 0.5,
                    "timestamp": 1619827200,
                    "readable_timestamp": "2021-04-01T00:00:00Z"
                }
            ]
        }
    ],
    "error_msg": "",
    "error_no": 0
}