当前位置:首页 > Windows程序 > 正文

open-flacon api历史数据

标签: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.jmwww.net/file/14353.html