fix missing self -.-
parent
637f37a560
commit
d1bb9d9816
|
|
@ -5,7 +5,7 @@ log = logging.getLogger(__name__)
|
|||
|
||||
|
||||
class Target:
|
||||
def send_data(date, status, time, url, protocol, station):
|
||||
def send_data(self, date, status, time, url, protocol, station):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ class Influx(Target):
|
|||
string = string.replace(c, "\\"+c)
|
||||
return string
|
||||
|
||||
def send_data(date, status, time, url, protocol, station=00):
|
||||
def send_data(self, date, status, time, url, protocol, station=00):
|
||||
data = "response_time,url={url},status={status},protocol={protocol},station={station} value={time} {timestamp}".format(
|
||||
url=influx_escape(url),
|
||||
status=influx_escape(str(status)),
|
||||
|
|
@ -29,11 +29,11 @@ class Influx(Target):
|
|||
protocol=self.escape(protocol),
|
||||
station=station
|
||||
)
|
||||
r=requests.post(INFLUX_URL, data=data)
|
||||
r = requests.post(INFLUX_URL, data=data)
|
||||
log.info(str(r) + " " + str(r.text))
|
||||
return r.ok
|
||||
|
||||
|
||||
TARGETS = {
|
||||
"Influx": Influx,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue