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
1ef54615
Commit
1ef54615
authored
Sep 04, 2019
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试获取用户画像方法
parent
1ed4a89f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
monitor.py
monitor.py
+10
-7
rerank_esmm.py
rerank_esmm.py
+0
-0
No files found.
monitor.py
View file @
1ef54615
...
@@ -192,9 +192,9 @@ def diary_write(device_id,cid):
...
@@ -192,9 +192,9 @@ def diary_write(device_id,cid):
# ssc.start()
# ssc.start()
# ssc.awaitTermination()
# ssc.awaitTermination()
def
make_data
(
device_id
,
city_id
):
def
make_data
(
device_id
,
city_id
,
key_head
):
r
=
redis
.
StrictRedis
.
from_url
(
"redis://redis.paas-test.env:6379/2"
)
r
=
redis
.
StrictRedis
.
from_url
(
"redis://redis.paas-test.env:6379/2"
)
key
=
"device_diary_queue_rerank:device_id:"
+
device_id
+
":city_id:"
+
city_id
key
=
key_head
+
device_id
+
":city_id:"
+
city_id
r
.
hset
(
name
=
key
,
key
=
"native_queue"
,
value
=
native
)
r
.
hset
(
name
=
key
,
key
=
"native_queue"
,
value
=
native
)
r
.
hset
(
name
=
key
,
key
=
"nearby_queue"
,
value
=
nearby
)
r
.
hset
(
name
=
key
,
key
=
"nearby_queue"
,
value
=
nearby
)
r
.
hset
(
name
=
key
,
key
=
"nation_queue"
,
value
=
nation
)
r
.
hset
(
name
=
key
,
key
=
"nation_queue"
,
value
=
nation
)
...
@@ -202,11 +202,14 @@ def make_data(device_id,city_id):
...
@@ -202,11 +202,14 @@ def make_data(device_id,city_id):
print
(
r
.
hgetall
(
key
))
print
(
r
.
hgetall
(
key
))
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
native
=
","
.
join
([
str
(
i
)
for
i
in
(
range
(
2
,
6
))])
native
=
","
.
join
([
str
(
i
)
for
i
in
(
range
(
69
,
72
))])
nearby
=
","
.
join
([
str
(
i
)
for
i
in
(
range
(
6
,
10
))])
nearby
=
","
.
join
([
str
(
i
)
for
i
in
(
range
(
73
,
76
))])
nation
=
","
.
join
([
str
(
i
)
for
i
in
(
range
(
10
,
13
))])
nation
=
","
.
join
([
str
(
i
)
for
i
in
(
range
(
77
,
80
))])
megacity
=
","
.
join
([
str
(
i
)
for
i
in
(
range
(
13
,
16
))])
megacity
=
","
.
join
([
str
(
i
)
for
i
in
(
range
(
81
,
83
))])
make_data
(
"hello"
,
"beijing"
)
# key_head = "device_diary_queue_rerank:device_id:"
key_head
=
"device_diary_queue:device_id:"
make_data
(
"868663038800471"
,
"beijing"
,
key_head
)
...
...
rerank_esmm.py
View file @
1ef54615
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