Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
streamingUserPortrait
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
赵威
streamingUserPortrait
Commits
7fac413d
Commit
7fac413d
authored
Feb 09, 2021
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add msg
parent
a88ffad6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
30 deletions
+41
-30
Main.scala
src/main/scala/com.gmei.up/Main.scala
+18
-16
DingTalk.scala
src/main/scala/com.gmei.up/utils/DingTalk.scala
+12
-5
Redis.scala
src/main/scala/com.gmei.up/utils/Redis.scala
+11
-9
No files found.
src/main/scala/com.gmei.up/Main.scala
View file @
7fac413d
...
@@ -110,23 +110,25 @@ object Main extends LazyLogging {
...
@@ -110,23 +110,25 @@ object Main extends LazyLogging {
logger
.
info
(
s
"${user.eventCn} ${deviceId}"
)
logger
.
info
(
s
"${user.eventCn} ${deviceId}"
)
val
cost
=
streamTimeBegin
-
user
.
sendTimestamp
val
cost
=
streamTimeBegin
-
user
.
sendTimestamp
val
msg
=
Map
(
"method"
->
"Main.main"
,
"deviceId"
->
deviceId
,
"eventCn"
->
user
.
eventCn
,
"action"
->
user
.
action
,
"cityId"
->
user
.
cityId
.
toString
,
"projects"
->
user
.
projects
.
mkString
(
" "
),
"diaryRead"
->
diaryRead
.
size
.
toString
,
"tractateRead"
->
tractateRead
.
size
.
toString
,
"answerRead"
->
answerRead
.
size
.
toString
,
"cost"
->
s
"${cost}ms"
,
"description"
->
"收到请求到开始处理的耗时"
)
if
(
deviceId
==
"64695DE0-B926-4188-9C62-D987DC20BEDF"
)
{
DingTalk
.
send
(
msg
,
contentType
=
"debug"
)
}
if
(
cost
>
1500
)
{
if
(
cost
>
1500
)
{
deviceId
==
"64695DE0-B926-4188-9C62-D987DC20BEDF"
DingTalk
.
send
(
msg
)
DingTalk
.
send
(
Map
(
"method"
->
"Main.main"
,
"deviceId"
->
deviceId
,
"eventCn"
->
user
.
eventCn
,
"action"
->
user
.
action
,
"cityId"
->
user
.
cityId
.
toString
,
"projects"
->
user
.
projects
.
mkString
(
" "
),
"diaryRead"
->
diaryRead
.
size
.
toString
,
"tractateRead"
->
tractateRead
.
size
.
toString
,
"answerRead"
->
answerRead
.
size
.
toString
,
"cost"
->
s
"${cost}ms"
,
"description"
->
"收到请求到开始处理的耗时"
)
)
}
}
deviceId
deviceId
...
...
src/main/scala/com.gmei.up/utils/DingTalk.scala
View file @
7fac413d
...
@@ -46,12 +46,19 @@ object DingTalk {
...
@@ -46,12 +46,19 @@ object DingTalk {
}
}
def
mkUrl
(
contentType
:
String
=
"msg"
)
:
String
=
{
def
mkUrl
(
contentType
:
String
=
"msg"
)
:
String
=
{
var
secret
=
"
SECa194492f061e5b422452baee55b45f95c68bcc9fdbfa0439e0fa3f36d25d8840
"
var
secret
=
""
var
token
=
"
c39b1c5344558f46a8d1450fafc20366e64434ec58578a94df12c0f4b03dbad8
"
var
token
=
""
if
(
contentType
!=
"msg"
)
{
contentType
match
{
secret
=
"SECc404abeefb4985e4ad1e3189bfbb3932b0005109fb5ecddc1f1f1526a1996f9c"
case
"debug"
=>
token
=
"c90b88ddf6be2398eb72429ee897a24fe3e80e85b1a896a7e5e091baf39344ca"
secret
=
"SECb6b55348a0859a83afd499bef8fd9a69df3bd7b983e65c32596e66c367c87adb"
token
=
"e9cb1271ab886e16d514899f62d4204a637f065c5086165a740cf18f67f9d7a8"
case
"exception"
=>
secret
=
"SECc404abeefb4985e4ad1e3189bfbb3932b0005109fb5ecddc1f1f1526a1996f9c"
token
=
"c90b88ddf6be2398eb72429ee897a24fe3e80e85b1a896a7e5e091baf39344ca"
case
_
=>
secret
=
"SECa194492f061e5b422452baee55b45f95c68bcc9fdbfa0439e0fa3f36d25d8840"
token
=
"c39b1c5344558f46a8d1450fafc20366e64434ec58578a94df12c0f4b03dbad8"
}
}
val
r
=
requests
.
get
(
"https://api.github.com/users/lihaoyi"
)
val
r
=
requests
.
get
(
"https://api.github.com/users/lihaoyi"
)
...
...
src/main/scala/com.gmei.up/utils/Redis.scala
View file @
7fac413d
...
@@ -63,16 +63,18 @@ object Redis {
...
@@ -63,16 +63,18 @@ object Redis {
}
}
client
.
expire
(
key
,
60
*
60
*
24
*
15
)
client
.
expire
(
key
,
60
*
60
*
24
*
15
)
val
total
=
System
.
currentTimeMillis
-
timeBegin
val
total
=
System
.
currentTimeMillis
-
timeBegin
val
msg
=
Map
(
"method"
->
"Redis.save"
,
"deviceId"
->
deviceId
,
"contentType"
->
contentType
,
"description"
->
"从流开始处理到存入结果的总耗时"
,
"streamTotalSeconds"
->
s
"${total}ms"
)
if
(
deviceId
==
"64695DE0-B926-4188-9C62-D987DC20BEDF"
)
{
DingTalk
.
send
(
msg
,
contentType
=
"debug"
)
}
if
(
total
>
1500
)
{
if
(
total
>
1500
)
{
DingTalk
.
send
(
DingTalk
.
send
(
msg
)
Map
(
"method"
->
"Redis.save"
,
"deviceId"
->
deviceId
,
"contentType"
->
contentType
,
"description"
->
"从流开始处理到存入结果的总耗时"
,
"streamTotalSeconds"
->
s
"${total}ms"
)
)
}
}
}
}
}
}
...
...
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