Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
co2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikita Yurishev
co2
Commits
5b1aef3d
Commit
5b1aef3d
authored
Aug 08, 2024
by
Nikita Yurishev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added connection to the influxdb, not lokalhost
parent
92faa681
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
influxConnection.py
influxConnection.py
+4
-4
No files found.
influxConnection.py
View file @
5b1aef3d
...
...
@@ -5,7 +5,7 @@ import time
class
InfluxConnection
:
def
__init__
(
self
):
# Конфиги
self
.
INFLUXDB_URL
=
'http://
localhost:8086
'
self
.
INFLUXDB_URL
=
'http://
influxdb.k8s.eterfund.ru
'
self
.
INFLUXDB_DB
=
''
self
.
INFLUXDB_USER
=
''
self
.
INFLUXDB_PASSWORD
=
''
...
...
@@ -13,8 +13,8 @@ class InfluxConnection:
# Разделение URL на хост и порт
url_parts
=
self
.
INFLUXDB_URL
.
split
(
'://'
)[
1
]
.
split
(
':'
)
host
=
url_parts
[
0
]
port
=
int
(
url_parts
[
1
])
if
len
(
url_parts
)
>
1
else
8086
#
port = int(url_parts[1]) if len(url_parts) > 1 else 8086
port
=
80
# Подключение к InfluxDB
self
.
client
=
InfluxDBClient
(
host
=
host
,
...
...
@@ -25,7 +25,7 @@ class InfluxConnection:
)
# Создание базы данных (если её нет)
self
.
client
.
create_database
(
self
.
INFLUXDB_DB
)
#
self.client.create_database(self.INFLUXDB_DB)
def
write_data
(
self
,
sensor_id
,
values
):
json_body
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment