metzoo的python sdk

metzoo-python-sdk的Python项目详细描述


使用说明:

>>> import metzoo
>>> # create an agent
>>> agent = metzoo.Agent(CUSTOMER_KEY, "agent.name")
<Agent 'agent.name', key: 'xxx...'>
>>> # or with an url
>>> agent = metzoo.Agent(CUSTOMER_KEY, "agent.name", "https://api.metzoo.com")
<Agent 'agent.name', key: 'xxx...'>
>>> # configure the metrics to use (optional)
>>> agent.configure({"metric1.name": "unit", "metric2.name": "unit"})
{"status":"ok"}
>>> # send data for given metrics using system time...
>>> agent.send({"metric1.name": 134.22, "metric2.name": 8123})
{"status":"ok"}
>>> # ...or using your own time
>>> agent.send({"metric1.name": 134.22, "metric2.name": 8123}, timestamp=1234567)
{"status":"ok"}
>>> # update own agent configuration (not implemented yet)
>>> agent.update()
{"status":"ok"}

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Clojure关键字在内存中的大小是多少?   Java中有固定长度的通用数组对象吗?   PostgreSQL:通过Java更新我的用户表   错误:使用java解析xml   java Json显示列表中对象的名称   java比较JodaTime时区   与JAVA中的API和包的区别?   java的int值在for循环中不改变   谷歌应用引擎中的java RSA   迁移到spring 5后出现java非法字符错误   java Websphere管理控制台不工作   JavaGSON如何始终在json中包含毫秒?   带有空格和双引号的windows Java ProcessBuilder命令参数失败   java错误:重复的zip条目[43.jar:org/apache/http/annotation/NotThreadSafe.class]