1 Star 0 Fork 0

jinyule/influx-proxy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
client_write.py 818 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2017-01-18
@author: Shell.Xu
@copyright: 2017, Eleme <zhixiang.xu@ele.me>
@license: MIT
'''
from __future__ import absolute_import, division,\
print_function, unicode_literals
import time
import requests
BASEURL = 'http://localhost:6666'
def once():
s = '''cpu,host=server01,region=uswest value=1 1434055562000000000
cpu value=3,value2=4 1434055562000010000
temperature,machine=unit42,type=assembly internal=32,external=100 1434055562000000035
temperature,machine=unit143,type=assembly internal=22,external=130 1434055562005000035'''
resp = requests.post(
BASEURL+'/write', params={'db': 'test'}, data=s)
print(resp.status_code)
def main():
while True:
once()
time.sleep(0.1)
if __name__ == '__main__':
main()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/jinyule/influx-proxy.git
git@gitee.com:jinyule/influx-proxy.git
jinyule
influx-proxy
influx-proxy
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385