Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
51439953
Commit
51439953
authored
6 years ago
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add time count
parent
820d7c38
master
gyz
mr/beta/bug22
offic
rtt
test
updatedb
wzw
zhao
zhao22
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
diaryUpdateOnlineOffline.py
diaryUpdateOnlineOffline.py
+6
-0
No files found.
diaryUpdateOnlineOffline.py
View file @
51439953
...
...
@@ -174,6 +174,7 @@ def update_dairy_queue(score_df,predict_score_df,total_video_id):
def
update_sql_dairy_queue
(
queue_name
,
diary_id
,
device_id
,
city_id
):
begin
=
time
.
time
()
if
flag
:
db
=
pymysql
.
connect
(
host
=
QUEUE_ONLINE_HOST
,
port
=
3306
,
user
=
'doris'
,
passwd
=
'o5gbA27hXHHm'
,
db
=
'doris_prod'
)
...
...
@@ -192,6 +193,8 @@ def update_sql_dairy_queue(queue_name, diary_id,device_id, city_id):
db
.
commit
()
print
(
"2bd"
)
db
.
close
()
over
=
time
.
time
()
print
(
"写入日记队列耗时{}秒"
.
format
(
over
-
begin
))
print
(
"成功写入diary_id"
)
...
...
@@ -217,6 +220,7 @@ def queue_compare(old_list, new_list):
def
get_queue
(
device_id
,
city_id
,
queue_name
):
begin
=
time
.
time
()
if
flag
:
db
=
pymysql
.
connect
(
host
=
QUEUE_ONLINE_HOST
,
port
=
3306
,
user
=
'doris'
,
passwd
=
'o5gbA27hXHHm'
,
db
=
'doris_prod'
)
...
...
@@ -229,6 +233,8 @@ def get_queue(device_id, city_id,queue_name):
"where device_id = '{}' and city_id = '{}';"
.
format
(
queue_name
,
device_id
,
city_id
)
cursor
.
execute
(
sql
)
result
=
cursor
.
fetchall
()
over
=
time
.
time
()
print
(
"获取日记队列耗时{}秒"
.
format
(
over
-
begin
))
df
=
pd
.
DataFrame
(
list
(
result
))
if
df
.
empty
:
print
(
"该用户对应的日记为空"
)
...
...
This diff is collapsed.
Click to expand it.
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