添加tap 2 influxdb脚本
This commit is contained in:
parent
5157037e3f
commit
820d100ae0
@ -19,7 +19,7 @@ class TAP2Influx:
|
|||||||
self.tga = FromTga(url=url, token=api_secret)
|
self.tga = FromTga(url=url, token=api_secret)
|
||||||
self.day = day
|
self.day = day
|
||||||
self.influx = InfluxDBClient('10.10.3.19', '8086', 'miles', 'aspect', 'tap_data')
|
self.influx = InfluxDBClient('10.10.3.19', '8086', 'miles', 'aspect', 'tap_data')
|
||||||
self.measurement = "tapdata_new"
|
self.measurement = "tapdata"
|
||||||
|
|
||||||
def get_tga_data(self):
|
def get_tga_data(self):
|
||||||
sql = f"""SELECT
|
sql = f"""SELECT
|
||||||
@ -46,11 +46,11 @@ class TAP2Influx:
|
|||||||
if data:
|
if data:
|
||||||
try:
|
try:
|
||||||
for line in data:
|
for line in data:
|
||||||
gameid, catename, cate, title, score, tag, reserve, watch, download, sell, review, topic, createdat = line
|
gameid, catename, cate, title, score, order, tag, reserve, watch, download, sell, review, topic, createdat = line
|
||||||
tags = {"gameid": int(gameid), "catename": catename}
|
tags = {"gameid": int(gameid), "catename": catename}
|
||||||
fields = {"title": title, "score": score, "tag": tag, "reserve": reserve, "watch": watch,
|
fields = {"title": title, "score": score, "tag": tag, "reserve": reserve, "watch": watch,
|
||||||
"download": download, "sell": sell, "review": review, "topic": topic, "cate": cate,
|
"download": download, "sell": sell, "review": review, "topic": topic, "cate": cate,
|
||||||
"catedat": createdat}
|
"catedat": createdat, "order": order}
|
||||||
temp = {"measurement": self.measurement, "tags": tags, "fields": fields}
|
temp = {"measurement": self.measurement, "tags": tags, "fields": fields}
|
||||||
body.append(temp)
|
body.append(temp)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user