Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
S
senseflux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
3
Snippets
Groups
Projects
Show more breadcrumbs
Sumit Khanna
senseflux
Compare revisions
76cafbdf5ad05b2579c62b8db8696466d37aa6b5 to 3aeff141cc47693af45156f6088372b3201745b8
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
djsumdog/senseflux
Select target project
No results found
3aeff141cc47693af45156f6088372b3201745b8
Select Git revision
Branches
docker-build
master
Tags
v0.0.1
v0.0.2
v0.0.3
v0.0.5
v0.0.6
v0.0.7
v0.0.8
v0.0.9
10 results
Swap
Target
djsumdog/senseflux
Select target project
djsumdog/senseflux
1 result
76cafbdf5ad05b2579c62b8db8696466d37aa6b5
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
correct field type update
· 3aeff141
Sumit Khanna
authored
4 years ago
3aeff141
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
senseflux/__main__.py
+3
-4
3 additions, 4 deletions
senseflux/__main__.py
with
3 additions
and
4 deletions
senseflux/__main__.py
View file @
3aeff141
...
...
@@ -50,10 +50,10 @@ def create_app(influxdb_client: InfluxDBClient, influxdb_database: str, api_key:
return
Response
(
status
=
401
)
lines
=
[]
log
.
info
(
f
"
Raw updates
{
data
[
'
updates
'
]
}
"
)
readings
=
fields_to_values
(
data
[
'
updates
'
])
# log.debug(f'Converted Readings {readings}')
for
r
in
readings
:
fields
=
'
,
'
.
join
([
f
'
{
k
}
=
"
{
v
}
"
'
for
k
,
v
in
r
.
items
()
if
k
!=
'
created_at
'
])
fields
=
'
,
'
.
join
([
f
'
{
k
}
=
{
v
}
'
for
k
,
v
in
r
.
items
()
if
k
!=
'
created_at
'
])
timestamp
=
int
(
veghub_time_to_timestamp
(
r
[
'
created_at
'
])
*
1e9
)
msg
=
f
'
{
channel
}
{
fields
}
{
timestamp
}
'
log
.
debug
(
f
'
Line:
{
msg
}
'
)
...
...
@@ -84,7 +84,6 @@ def main(port, api_key, influxdb_host, influxdb_port, influxdb_database, influxd
influxdb_client
.
switch_database
(
influxdb_database
)
app
=
create_app
(
influxdb_client
,
influxdb_database
,
api_key
)
serve
(
app
,
listen
=
f
'
*:
{
port
}
'
)
# app.run(host='0.0.0.0', port=port)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.