Loading
close

topN的cpu,memory利用率

time 更新时间:2022-04-27 17:40:06

URI

GET /v1/top

请求参数

名称 是否可选 类型 描述
metric String 指标:cpu 或者 memory
start Date UTC
end Date UTC

请求示例

curl -g -i -X 'GET' -H "X-Auth-Token: gAAAAABgf9rsK32RsEd32-xjinUnkr9Hyv_ZixiLLHNI8ipaimm7peKGnEvo62PA1PzwyPzjO9zDGHY41NRP6nz_r9jA_Cd57V7-MiorJBnCKVfDAqSBW9Gb77VwLioFtH05EsoBpgOtzirlHU3sqmjLlLeLTQNMlMtOAm-7C3Ij9G1Yc0Y6BfA" 'http://gnocchi.openstack.svc.cluster.local:80/v1/top?metric=cpu_util&start=2019-07-12T05:22:49&stop=2019-07-12T05:27:49'

响应参数

名称 输入 类型 描述
resourceId body String 资源ID
projectId body String 项目ID
value body String
resourceName body String 资源名称

响应示例

需要用户对数组中的每个元素的value属性自行排序,并截取需要的前n个元素做为top N的结果

[{
  "resourceId": "b2c605c4-1b28-4231-bb86-96a302877b12",
  "projectId": "93017ffe922a4a57888030096cdff339",
  "value": 0.049991061699150005,
  "resourceName": "test111"
}, {
  "resourceId": "adcace23-ab26-41e7-9c39-ce3b22ca35c4",
  "projectId": "93017ffe922a4a57888030096cdff339",
  "value": 0.053323155255983,
  "resourceName": "222"
}, {
  "resourceId": "b3c57b15-3515-4e90-b4e3-d3ba59eb848f",
  "projectId": "472c3f835ed7429dad11de1ca86a290a",
  "value": 0.04665801254021,
  "resourceName": "test"
}, {
  "resourceId": "0ea18a95-decb-4fee-8bea-cdffa0490b36",
  "projectId": "93017ffe922a4a57888030096cdff339",
  "value": 0.049990980142778,
  "resourceName": "testyj"
}, {
  "resourceId": "0e8be37f-304c-46f0-8405-a688ec61857a",
  "projectId": "93017ffe922a4a57888030096cdff339",
  "value": 0.046658841920707,
  "resourceName": "111"
}, {
  "resourceId": "6eb9e496-be1e-4ded-a75a-ea1984f3aa97",
  "projectId": "93017ffe922a4a57888030096cdff339",
  "value": 0.049992017724874,
  "resourceName": "666"
}, {
  "resourceId": "8798ecc7-4de6-4407-9450-911927545228",
  "projectId": "93017ffe922a4a57888030096cdff339",
  "value": 0.049991277176357006,
  "resourceName": "444"
}, {
  "resourceId": "62cbb24b-ef43-4ba9-b222-9468e9d32459",
  "projectId": "93017ffe922a4a57888030096cdff339",
  "value": 0.053322680856260005,
  "resourceName": "333"
}, {
  "resourceId": "39999184-8fe0-49ac-8c2a-c1cb435ead19",
  "projectId": "93017ffe922a4a57888030096cdff339",
  "value": 0.046659487682838,
  "resourceName": "555"
}]
此篇文章对你是否有帮助?
没帮助
locked-file

您暂无权限访问该产品