Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpha
physical
Commits
a119243e
Commit
a119243e
authored
Oct 18, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
3318155f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
collect_data.py
linucb/views/collect_data.py
+3
-3
No files found.
linucb/views/collect_data.py
View file @
a119243e
...
@@ -242,15 +242,15 @@ class CollectData(object):
...
@@ -242,15 +242,15 @@ class CollectData(object):
device_tag_ctr
=
LikeDeviceTagStat
.
objects
.
using
(
settings
.
SLAVE1_DB_NAME
)
.
filter
(
device_tag_ctr
=
LikeDeviceTagStat
.
objects
.
using
(
settings
.
SLAVE1_DB_NAME
)
.
filter
(
device_id
=
device_id
,
tag_id
=
tag_id
)
.
values
(
"tag_ctr_30"
)
device_id
=
device_id
,
tag_id
=
tag_id
)
.
values
(
"tag_ctr_30"
)
if
device_tag_ctr
:
if
device_tag_ctr
:
device_tag_ctr_value
=
device_tag_ctr
[
0
]
.
get
(
"tag_ctr_30"
,
0
.0
)
device_tag_ctr_value
=
device_tag_ctr
[
0
]
.
get
(
"tag_ctr_30"
,
1
.0
)
else
:
else
:
device_tag_ctr_value
=
0
.0
device_tag_ctr_value
=
1
.0
logging
.
info
(
"get_device_tag_ctr"
+
str
(
device_id
)
+
str
(
tag_id
))
logging
.
info
(
"get_device_tag_ctr"
+
str
(
device_id
)
+
str
(
tag_id
))
return
device_tag_ctr_value
return
device_tag_ctr_value
except
:
except
:
logging_exception
()
logging_exception
()
logging
.
error
(
"get_device_tag_ctr error!"
)
logging
.
error
(
"get_device_tag_ctr error!"
)
return
0
.0
return
1
.0
def
consume_data_from_kafka
(
self
,
topic_name
=
None
):
def
consume_data_from_kafka
(
self
,
topic_name
=
None
):
try
:
try
:
...
...
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