swapped capitalization
This commit is contained in:
parent
2e158212d2
commit
8b2056ad66
8 changed files with 487 additions and 13 deletions
16
varken/dbmanager.py
Normal file
16
varken/dbmanager.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
from influxdb import InfluxDBClient
|
||||
|
||||
|
||||
class DBManager(object):
|
||||
def __init__(self, server):
|
||||
self.server = server
|
||||
self.influx = InfluxDBClient(self.server.url, self.server.port, self.server.username, self.server.password,
|
||||
'varken')
|
||||
databases = [db['name'] for db in self.influx.get_list_database()]
|
||||
|
||||
if 'varken' not in databases:
|
||||
self.influx.create_database('varken')
|
||||
self.influx.create_retention_policy('varken 30d/1h', '30d', '1', 'varken', False, '1h')
|
||||
|
||||
def write_points(self, data):
|
||||
self.influx.write_points(data)
|
Loading…
Add table
Add a link
Reference in a new issue