新增实时数据采集脚本

This commit is contained in:
pengtao 2019-08-19 17:04:09 +08:00
parent 3e5bcc4e47
commit bc75abd022
2 changed files with 2 additions and 1 deletions

View File

@ -3,5 +3,5 @@
# gameid,channel,event_type # gameid,channel,event_type
is_debug = True is_debug = True
My_influx = {'host': '10.10.3.19', 'port': 8086, 'username': 'miles', 'password': 'aspect', 'database': 'useronline'} My_influx = {'host': '10.10.3.19', 'port': 8086, 'username': 'miles', 'password': 'aspect', 'database': 'real_data'}
influx_meas = 'real_game_data' influx_meas = 'real_game_data'

View File

@ -16,6 +16,7 @@ class Myinflux:
def _write(self, body): def _write(self, body):
try: try:
self.influxdb.write_points(body) self.influxdb.write_points(body)
print(f"write {body} 2 influx!")
return True return True
except exceptions.InfluxDBClientError: except exceptions.InfluxDBClientError:
log.error(f"write {body} to influx failed!", exc_info=True) log.error(f"write {body} to influx failed!", exc_info=True)