Commit 1ff209ba by liushutao

统计envoy数据

parent 729a1e69
...@@ -62,7 +62,7 @@ public class SmsPushsysServiceImpl implements SmsPushsysService { ...@@ -62,7 +62,7 @@ public class SmsPushsysServiceImpl implements SmsPushsysService {
//获取当前时间的前一分钟 //获取当前时间的前一分钟
String createTime = DateUtils.getDateStringYMDHMS(nowDate,DateUtils.DATE_TIME_PATTERN_YYYYMMDDHHMMSSSSS); String createTime = DateUtils.getDateStringYMDHMS(nowDate,DateUtils.DATE_TIME_PATTERN_YYYYMMDDHHMMSSSSS);
smsPushsysMapper.insertXCKProStatisEnvoyMin(UUID.randomUUID().toString(),endTime,result,createTime); smsPushsysMapper.insertXCKProStatisEnvoyMin(UUID.randomUUID().toString(),endTime,result,createTime);
log.info("统计envoy,从时间:"+startTime+"-------"+endTime+"的请求总数:"+result); log.info("统计envoy日志时间:"+startTimeStr+"----"+endTimeStr+"的请求总数:"+result+"====>入库时间:"+endTime);
return result; return result;
} }
......
...@@ -25,6 +25,11 @@ public class FiveIndexMonitorTask { ...@@ -25,6 +25,11 @@ public class FiveIndexMonitorTask {
@Value("${before-minute}") @Value("${before-minute}")
Integer beforeminutes; Integer beforeminutes;
@Value("${before-end-minute}")
Integer beforeendminutes;
@Value("${input-minute}")
Integer inputminute;
@Resource @Resource
SmsPushsysService smsPushsysService; SmsPushsysService smsPushsysService;
...@@ -40,8 +45,9 @@ public class FiveIndexMonitorTask { ...@@ -40,8 +45,9 @@ public class FiveIndexMonitorTask {
Date startDate = DateUtils.getDate(nowDate,beforeminutes); Date startDate = DateUtils.getDate(nowDate,beforeminutes);
String startTime = DateUtils.getDateStringYMDHMS(startDate,DateUtils.DATE_TIME_PATTERN); String startTime = DateUtils.getDateStringYMDHMS(startDate,DateUtils.DATE_TIME_PATTERN);
String startTimestr = DateUtils.getDateStringYMDHMS(startDate,DateUtils.DATE_YYYYMMDDHHMMSS); String startTimestr = DateUtils.getDateStringYMDHMS(startDate,DateUtils.DATE_YYYYMMDDHHMMSS);
Date endDate = DateUtils.getDate(nowDate,-1); Date endDate = DateUtils.getDate(nowDate,beforeendminutes);
String endTime = DateUtils.getDateStringYMDHMS(endDate,DateUtils.DATE_TIME_PATTERNS); Date endDates = DateUtils.getDate(nowDate,inputminute);
String endTime = DateUtils.getDateStringYMDHMS(endDates,DateUtils.DATE_TIME_PATTERNS);
String endTimestr = DateUtils.getDateStringYMDHMS(endDate,DateUtils.DATE_YYYYMMDDHHMMSS); String endTimestr = DateUtils.getDateStringYMDHMS(endDate,DateUtils.DATE_YYYYMMDDHHMMSS);
smsPushsysService.pushTravelCardByMinRate(startTime,endTime,startTimestr,endTimestr); smsPushsysService.pushTravelCardByMinRate(startTime,endTime,startTimestr,endTimestr);
} }
......
...@@ -28,7 +28,10 @@ shell: ...@@ -28,7 +28,10 @@ shell:
springTiming: springTiming:
monitor1-min-time: "0 0/1 * * * ?" monitor1-min-time: "0 0/1 * * * ?"
before-minute: -2 before-minute: -482
before-end-minute: -481
input-minute: -1
jasypt: jasypt:
encryptor: encryptor:
...@@ -40,3 +43,5 @@ logging: ...@@ -40,3 +43,5 @@ logging:
# 设定日志的级别 # 设定日志的级别
root: info root: info
log:
path: /app/pmc/logs
\ No newline at end of file
...@@ -39,25 +39,6 @@ ...@@ -39,25 +39,6 @@
<appender-ref ref="FILE" /> <appender-ref ref="FILE" />
</logger> </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" /> <include resource="org/springframework/boot/logging/logback/base.xml" />
<jmxConfigurator /> <jmxConfigurator />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment