open-flacon api历史数据

2021-03-20 23:24

阅读:623

标签:int   time()   print   port   min   request   idle   text   api   

#!-*- coding:utf8 -*-

import requests
import time
import json

end = int(time.time())
start = end - 3600  #查询过去一小时的数据

d = {
        "start": start,
        "end": end,
        "cf": "AVERAGE",
        "endpoint_counters": [
            {
                "endpoint": "host1",
                "counter": "cpu.idle",
            },
            {
                "endpoint": "host1",
                "counter": "load.1min",
            },
        ],
}

url = "http://127.0.0.1:9966/graph/history"
r = requests.post(url, data=json.dumps(d))
print r.text

open-flacon api历史数据

标签:int   time()   print   port   min   request   idle   text   api   

原文地址:https://www.cnblogs.com/oracle614/p/11844564.html


评论


亲,登录后才可以留言!