Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loganalysis
Overview
Overview
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
liushutao
loganalysis
Commits
1ff209ba
Commit
1ff209ba
authored
Nov 18, 2022
by
liushutao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计envoy数据
parent
729a1e69
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
23 deletions
+16
-23
src/main/java/com/pmc/loganalysis/service/impl/SmsPushsysServiceImpl.java
+1
-1
src/main/java/com/pmc/loganalysis/task/FiveIndexMonitorTask.java
+8
-2
src/main/resources/application-prod.yml
+7
-1
src/main/resources/logback-spring.xml
+0
-19
No files found.
src/main/java/com/pmc/loganalysis/service/impl/SmsPushsysServiceImpl.java
View file @
1ff209ba
...
...
@@ -62,7 +62,7 @@ public class SmsPushsysServiceImpl implements SmsPushsysService {
//获取当前时间的前一分钟
String
createTime
=
DateUtils
.
getDateStringYMDHMS
(
nowDate
,
DateUtils
.
DATE_TIME_PATTERN_YYYYMMDDHHMMSSSSS
);
smsPushsysMapper
.
insertXCKProStatisEnvoyMin
(
UUID
.
randomUUID
().
toString
(),
endTime
,
result
,
createTime
);
log
.
info
(
"统计envoy
,从时间:"
+
startTime
+
"-------"
+
endTime
+
"的请求总数:"
+
result
);
log
.
info
(
"统计envoy
日志时间:"
+
startTimeStr
+
"----"
+
endTimeStr
+
"的请求总数:"
+
result
+
"====>入库时间:"
+
endTime
);
return
result
;
}
...
...
src/main/java/com/pmc/loganalysis/task/FiveIndexMonitorTask.java
View file @
1ff209ba
...
...
@@ -25,6 +25,11 @@ public class FiveIndexMonitorTask {
@Value
(
"${before-minute}"
)
Integer
beforeminutes
;
@Value
(
"${before-end-minute}"
)
Integer
beforeendminutes
;
@Value
(
"${input-minute}"
)
Integer
inputminute
;
@Resource
SmsPushsysService
smsPushsysService
;
...
...
@@ -40,8 +45,9 @@ public class FiveIndexMonitorTask {
Date
startDate
=
DateUtils
.
getDate
(
nowDate
,
beforeminutes
);
String
startTime
=
DateUtils
.
getDateStringYMDHMS
(
startDate
,
DateUtils
.
DATE_TIME_PATTERN
);
String
startTimestr
=
DateUtils
.
getDateStringYMDHMS
(
startDate
,
DateUtils
.
DATE_YYYYMMDDHHMMSS
);
Date
endDate
=
DateUtils
.
getDate
(
nowDate
,-
1
);
String
endTime
=
DateUtils
.
getDateStringYMDHMS
(
endDate
,
DateUtils
.
DATE_TIME_PATTERNS
);
Date
endDate
=
DateUtils
.
getDate
(
nowDate
,
beforeendminutes
);
Date
endDates
=
DateUtils
.
getDate
(
nowDate
,
inputminute
);
String
endTime
=
DateUtils
.
getDateStringYMDHMS
(
endDates
,
DateUtils
.
DATE_TIME_PATTERNS
);
String
endTimestr
=
DateUtils
.
getDateStringYMDHMS
(
endDate
,
DateUtils
.
DATE_YYYYMMDDHHMMSS
);
smsPushsysService
.
pushTravelCardByMinRate
(
startTime
,
endTime
,
startTimestr
,
endTimestr
);
}
...
...
src/main/resources/application-prod.yml
View file @
1ff209ba
...
...
@@ -28,7 +28,10 @@ shell:
springTiming
:
monitor1-min-time
:
"
0
0/1
*
*
*
?"
before-minute
:
-2
before-minute
:
-482
before-end-minute
:
-481
input-minute
:
-1
jasypt
:
encryptor
:
...
...
@@ -40,3 +43,5 @@ logging:
# 设定日志的级别
root
:
info
log
:
path
:
/app/pmc/logs
\ No newline at end of file
src/main/resources/logback-spring.xml
View file @
1ff209ba
...
...
@@ -39,25 +39,6 @@
<appender-ref
ref=
"FILE"
/>
</logger>
<!-- 输出到文件 -->
<appender
name=
"interfaceLog"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 配置滚动的策略 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 日志名称的格式 -->
<FileNamePattern>
${LOG_HOME}/interfaceLog/interfaceLog-%d{yyyy-MM-dd}.log
</FileNamePattern>
<!-- 保存的最长时间:天数 -->
<!--<MaxHistory>30</MaxHistory>-->
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<pattern>
[${instanceIp}]%date %highlight([%-5.5level]) [%-10.10thread] [%X{user_mobile}] [%X{X-B3-TraceId}/%X{X-B3-SpanId}] %cyan([%-50.50class:%-4.4line]) - %msg%xEx%n
</pattern>
<charset>
utf-8
</charset>
</encoder>
</appender>
<logger
name=
"interfaceLogger"
level=
"info"
additivity=
"false"
>
<!--指定自定义的appender来处理-->
<appender-ref
ref=
"interfaceLog"
/>
</logger>
<include
resource=
"org/springframework/boot/logging/logback/base.xml"
/>
<jmxConfigurator
/>
...
...
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