调用GetCloudMetricLogs获取E-HPC性能指标日志。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String GetCloudMetricLogs

系统规定参数。取值:GetCloudMetricLogs

ClusterId String ehpc-hz-jeJki6****

集群ID。

From Integer 1583907780

查询开始时间点。Unix时间戳类型,表示从1970-1-1 00:00:00 UTC计算起的秒数。

To Integer 1583907790

查询结束时间点。Unix时间戳类型,表示从1970-1-1 00:00:00 UTC计算起的秒数。

Reverse Boolean false

按时间逆序返回日志。

默认值:false

AggregationType String avg

数据聚合类别。取值范围:

  • sum:统计和
  • avg:平均值
  • max:最大值
  • min:最小值

默认不使用聚合。

AggregationInterval Integer 10

数据聚合间隔。单位:秒

取值范围:1、10、60、600、3600

默认值:1

MetricScope String network

性能指标的维度。取值范围:

  • machine: 整机
  • process:进程
  • network:网络
  • disk:磁盘
Filter String {"Hostname":"compute000"}

指定过滤条件。JSON格式字符串,包含若干key:value对。key的取值范围:

  • InstanceId:节点ID
  • Hostname:节点主机名称
  • NetworkInterface:网络接口名称
  • DiskDevice:磁盘设备名称
MetricCategories String cpu

输出性能指标的类别,多个指标用半角逗号(,)隔开。取值范围:

  • cpu:CPU
  • memory:内存

返回数据

名称 类型 示例值 描述
MetricLogs Array of MetricLog

性能数据列表。

MetricLog
DiskDevice String vda1

磁盘设备名称。

Hostname String compute000

节点主机名称。

InstanceId String i-bp132g97g7zwnvta****

节点ID。

MetricData String [1583907325 0.0202 0.0101 0.1088]

JSON序列化字符串,包含多个类别性能指标数值。

NetworkInterface String eth1

网络接口名称。

Time Integer 1583907780

日志时间戳。Unix时间戳类型,表示从1970-1-1 00:00:00 UTC计算起的秒数。

RequestId String 015C2C4D-1884-4EB7-BCD3-C5BB8D7E56DB

请求ID。

示例

请求示例

https://ehpc.cn-hangzhou.aliyuncs.com/?Action=GetCloudMetricLogs
&ClusterId=ehpc-hz-jeJki6****
&From=1583907780
&To=1583907790
&<公共请求参数>

正常返回示例

XML格式

<GetCloudMetricLogsResponse>
      <RequestId>970A2FDC-0DCF-4C00-A262-65622FB23D25</RequestId>
      <MetricLogs>
            <MetricLog>
                  <InstanceId>i-bp1j5ufgjy8****</InstanceId>
                  <Hostname>login0</Hostname>
                  <Time>1583907780</Time>
                  <MetricData>{"cputil|idle":0.9708,"cputil|user":0.0181,"cputil|sys":0.0111,"cputil|iowait":0,"cputil|usage":0.0292,"memory|memusage":0.2071,"memory|memcached":0.5467,"memory|swapusage":0,"process|cpusage":0.0101,"process|cpuser":0.0101,"process|cpusys":0,"process|memusage":0.0144,"process|procName":"\"ilogtail\"","process|stat":"\"S\"","process|pid":9054,"process|vss":255467520,"process|rss":3653,"disk_usage|max_usage":0.0875,"disk_usage|total":"null","disk_usage|used":"null","disk_usage|avail":"null","disk_usage|usage":"null","disk_bw|max_bw":30.8,"disk_bw|read":"null","disk_bw|write":"null","network|recv_rate":0.4923,"network|sent_rate":3.0477,"network|max_bw":3.5399}</MetricData>
            </MetricLog>
            <MetricLog>
                  <InstanceId>i-bp132s7zwnvta****</InstanceId>
                  <Hostname>compute000</Hostname>
                  <Time>1583907780</Time>
                  <MetricData>{"disk_usage|max_usage":0.0906,"disk_usage|total":"null","disk_usage|used":"null","disk_usage|avail":"null","disk_usage|usage":"null","network|recv_rate":0.4137,"network|sent_rate":2.5123,"network|max_bw":2.926,"process|cpusage":0,"process|cpuser":0,"process|cpusys":0,"process|memusage":0.0107,"process|procName":"\"cloud-metrics-a\"","process|stat":"\"R\"","process|pid":21404,"process|vss":230797312,"process|rss":2722,"memory|memusage":0.2041,"memory|memcached":0.5456,"memory|swapusage":0,"disk_bw|max_bw":2.4,"disk_bw|read":"null","disk_bw|write":"null","cputil|idle":0.9616,"cputil|user":0.0192,"cputil|sys":0.0192,"cputil|iowait":0,"cputil|usage":0.0384}</MetricData>
            </MetricLog>
            <MetricLog>
                  <InstanceId>i-bp132g97g7zwnvta****</InstanceId>
                  <Hostname>account</Hostname>
                  <Time>1583907780</Time>
                  <MetricData>{"process|cpusage":0.02,"process|cpuser":0.01,"process|cpusys":0.01,"process|memusage":0.0108,"process|procName":"\"cloud-metrics-a\"","process|stat":"\"R\"","process|pid":21404,"process|vss":230866944,"process|rss":2754,"memory|memusage":0.1987,"memory|memcached":0.5553,"memory|swapusage":0,"cputil|idle":0.9647,"cputil|user":0.0192,"cputil|sys":0.0161,"cputil|iowait":0,"cputil|usage":0.0353,"network|recv_rate":1.0313,"network|sent_rate":3.2593,"network|max_bw":4.2906,"disk_usage|max_usage":0.0877,"disk_usage|total":"null","disk_usage|used":"null","disk_usage|avail":"null","disk_usage|usage":"null","disk_bw|max_bw":3.2,"disk_bw|read":"null","disk_bw|write":"null"}</MetricData>
            </MetricLog>
            <MetricLog>
                  <InstanceId>i-bp18uqqfw68k****</InstanceId>
                  <Hostname>compute012</Hostname>
                  <Time>1583907780</Time>
                  <MetricData>{"process|cpusage":0,"process|cpuser":0,"process|cpusys":0,"process|memusage":0.0023,"process|procName":"\"ypbind\"","process|stat":"\"S\"","process|pid":29573,"process|vss":257601536,"process|rss":1098,"disk_bw|max_bw":34.8,"disk_bw|read":"null","disk_bw|write":"null","cputil|idle":0.9698,"cputil|user":0.0161,"cputil|sys":0.0131,"cputil|iowait":0.001,"cputil|usage":0.0302,"disk_usage|max_usage":0.0968,"disk_usage|total":"null","disk_usage|used":"null","disk_usage|avail":"null","disk_usage|usage":"null","network|recv_rate":0.5299,"network|sent_rate":2.8043,"network|max_bw":3.3342,"memory|memusage":0.1081,"memory|memcached":0.7383,"memory|swapusage":0}</MetricData>
            </MetricLog>
      </MetricLogs>
</GetCloudMetricLogsResponse>

JSON格式

{
	"GetCloudMetricLogsResponse":{
    "RequestId": "970A2FDC-0DCF-4C00-A262-65622FB23D25",
	"MetricLogs": {
		"MetricLog": [
			{
				"InstanceId": "i-bp1j5ufgjy8****",
				"Hostname": "login0",
				"Time": 1583907780,
				"MetricData": "{\"cputil|idle\":0.9708,\"cputil|user\":0.0181,\"cputil|sys\":0.0111,\"cputil|iowait\":0,\"cputil|usage\":0.0292,\"memory|memusage\":0.2071,\"memory|memcached\":0.5467,\"memory|swapusage\":0,\"process|cpusage\":0.0101,\"process|cpuser\":0.0101,\"process|cpusys\":0,\"process|memusage\":0.0144,\"process|procName\":\"\\\"ilogtail\\\"\",\"process|stat\":\"\\\"S\\\"\",\"process|pid\":9054,\"process|vss\":255467520,\"process|rss\":3653,\"disk_usage|max_usage\":0.0875,\"disk_usage|total\":\"null\",\"disk_usage|used\":\"null\",\"disk_usage|avail\":\"null\",\"disk_usage|usage\":\"null\",\"disk_bw|max_bw\":30.8,\"disk_bw|read\":\"null\",\"disk_bw|write\":\"null\",\"network|recv_rate\":0.4923,\"network|sent_rate\":3.0477,\"network|max_bw\":3.5399}"
			},
			{
				"InstanceId": "i-bp132s7zwnvta****",
				"Hostname": "compute000",
				"Time": 1583907780,
				"MetricData": "{\"disk_usage|max_usage\":0.0906,\"disk_usage|total\":\"null\",\"disk_usage|used\":\"null\",\"disk_usage|avail\":\"null\",\"disk_usage|usage\":\"null\",\"network|recv_rate\":0.4137,\"network|sent_rate\":2.5123,\"network|max_bw\":2.926,\"process|cpusage\":0,\"process|cpuser\":0,\"process|cpusys\":0,\"process|memusage\":0.0107,\"process|procName\":\"\\\"cloud-metrics-a\\\"\",\"process|stat\":\"\\\"R\\\"\",\"process|pid\":21404,\"process|vss\":230797312,\"process|rss\":2722,\"memory|memusage\":0.2041,\"memory|memcached\":0.5456,\"memory|swapusage\":0,\"disk_bw|max_bw\":2.4,\"disk_bw|read\":\"null\",\"disk_bw|write\":\"null\",\"cputil|idle\":0.9616,\"cputil|user\":0.0192,\"cputil|sys\":0.0192,\"cputil|iowait\":0,\"cputil|usage\":0.0384}"
			},
			{
				"InstanceId": "i-bp132g97g7zwnvta****",
				"Hostname": "account",
				"Time": 1583907780,
				"MetricData": "{\"process|cpusage\":0.02,\"process|cpuser\":0.01,\"process|cpusys\":0.01,\"process|memusage\":0.0108,\"process|procName\":\"\\\"cloud-metrics-a\\\"\",\"process|stat\":\"\\\"R\\\"\",\"process|pid\":21404,\"process|vss\":230866944,\"process|rss\":2754,\"memory|memusage\":0.1987,\"memory|memcached\":0.5553,\"memory|swapusage\":0,\"cputil|idle\":0.9647,\"cputil|user\":0.0192,\"cputil|sys\":0.0161,\"cputil|iowait\":0,\"cputil|usage\":0.0353,\"network|recv_rate\":1.0313,\"network|sent_rate\":3.2593,\"network|max_bw\":4.2906,\"disk_usage|max_usage\":0.0877,\"disk_usage|total\":\"null\",\"disk_usage|used\":\"null\",\"disk_usage|avail\":\"null\",\"disk_usage|usage\":\"null\",\"disk_bw|max_bw\":3.2,\"disk_bw|read\":\"null\",\"disk_bw|write\":\"null\"}"
			},
			{
				"InstanceId": "i-bp18uqqfw68k****",
				"Hostname": "compute012",
				"Time": 1583907780,
				"MetricData": "{\"process|cpusage\":0,\"process|cpuser\":0,\"process|cpusys\":0,\"process|memusage\":0.0023,\"process|procName\":\"\\\"ypbind\\\"\",\"process|stat\":\"\\\"S\\\"\",\"process|pid\":29573,\"process|vss\":257601536,\"process|rss\":1098,\"disk_bw|max_bw\":34.8,\"disk_bw|read\":\"null\",\"disk_bw|write\":\"null\",\"cputil|idle\":0.9698,\"cputil|user\":0.0161,\"cputil|sys\":0.0131,\"cputil|iowait\":0.001,\"cputil|usage\":0.0302,\"disk_usage|max_usage\":0.0968,\"disk_usage|total\":\"null\",\"disk_usage|used\":\"null\",\"disk_usage|avail\":\"null\",\"disk_usage|usage\":\"null\",\"network|recv_rate\":0.5299,\"network|sent_rate\":2.8043,\"network|max_bw\":3.3342,\"memory|memusage\":0.1081,\"memory|memcached\":0.7383,\"memory|swapusage\":0}"
			}
		]
	}
}
}

错误码

HttpCode 错误码 错误信息 描述
503 ServiceUnavailable The request has failed due to a temporary failure of the server 请求失败,服务暂时不可用

访问错误中心查看更多错误码。