日志修改,和注释无用内容
parent
ddca7dfd7f
commit
dac102e271
|
|
@ -1,15 +1,5 @@
|
|||
{
|
||||
"version":"6",
|
||||
"version":"5",
|
||||
"classes": [
|
||||
{"name":"BuyGoodsNewLogic.class","fullName":"com.ljsd.jieling.logic.store.BuyGoodsNewLogic"},
|
||||
{"name":"SuperBoxActivity.class","fullName":"com.ljsd.jieling.logic.activity.SuperBoxActivity"},
|
||||
{"name":"SevenWorldActivity.class","fullName":"com.ljsd.jieling.logic.activity.SevenWorldActivity"},
|
||||
{"name":"WeekCardActivity.class","fullName":"com.ljsd.jieling.logic.activity.WeekCardActivity"},
|
||||
{"name":"RechargeFirstActivity.class","fullName":"com.ljsd.jieling.logic.activity.RechargeFirstActivity"},
|
||||
{"name":"NewRechargeSumDayActivity.class","fullName":"com.ljsd.jieling.logic.activity.NewRechargeSumDayActivity"},
|
||||
{"name":"InfiniteResourcesPavilionActivity.class","fullName":"com.ljsd.jieling.logic.activity.InfiniteResourcesPavilionActivity"},
|
||||
{"name":"SuperFundNewActivity.class","fullName":"com.ljsd.jieling.logic.activity.SuperFundNewActivity"},
|
||||
{"name":"FengshenTreasureActivity.class","fullName":"com.ljsd.jieling.logic.activity.FengshenTreasureActivity"},
|
||||
{"name":"ContinuousGiftActivity.class","fullName":"com.ljsd.jieling.logic.activity.ContinuousGiftActivity"}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
//package com.ljsd.jieling.aspect;
|
||||
//
|
||||
//import org.aspectj.lang.ProceedingJoinPoint;
|
||||
//import org.aspectj.lang.annotation.Around;
|
||||
//import org.aspectj.lang.annotation.Aspect;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//@Aspect
|
||||
//@Component
|
||||
//public class LoggingAndTimingAspect {
|
||||
//
|
||||
// private static final Logger LOGGER = LoggerFactory.getLogger(LoggingAndTimingAspect.class);
|
||||
//
|
||||
// // 切点表达式,匹配你想要拦截的方法
|
||||
// // 假设sendGoods方法位于某个类中,比如GoodsService
|
||||
// // 并且你想要拦截所有参数类型的sendGoods方法
|
||||
// // 如果你想要更精确地匹配,可以指定参数类型,例如:execution(Result sendGoods(int, String, String, String, long, int))
|
||||
// // 注意:切点表达式的编写需要根据实际的方法签名来调整
|
||||
// @Around("execution(* com.yourpackage.GoodsService.sendGoods(..))")
|
||||
// public Object logAndTimeMethod(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
// long start = System.currentTimeMillis();
|
||||
//
|
||||
// // 记录方法开始执行的日志
|
||||
// LOGGER.info("开始执行方法: {}", joinPoint.getSignature().getName());
|
||||
//
|
||||
// // 执行目标方法,并获取返回值
|
||||
// Object result = joinPoint.proceed();
|
||||
//
|
||||
// // 记录方法执行完成的日志和执行时间
|
||||
// long elapsedTime = System.currentTimeMillis() - start;
|
||||
// LOGGER.info("方法执行完成: {}, 耗时: {} ms", joinPoint.getSignature().getName(), elapsedTime);
|
||||
//
|
||||
// return result; // 返回目标方法的执行结果
|
||||
// }
|
||||
//}
|
||||
|
|
@ -396,6 +396,7 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
* @param filterMissId miss过滤
|
||||
*/
|
||||
public void sendActivityProgress(ISession session, Set<Integer> filterMissId){
|
||||
long now = TimeUtils.now();
|
||||
if (session == null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -412,6 +413,7 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
.setActivityId(id);
|
||||
builder.setActivityInfo(builder1);
|
||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.ACTIVITY_UPDATE_PROGRESS_INDICATION_VALUE, builder.build(), true);
|
||||
LOGGER.info("活动信息推送id:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
}
|
||||
|
||||
public void sendActivityProgress(User user, Set<Integer> filterMissId) {
|
||||
|
|
|
|||
|
|
@ -42,14 +42,26 @@ class NewRechargeSumDayActivity extends AbstractActivity {
|
|||
if (!(event instanceof SuperBoxEvent)) {
|
||||
return;
|
||||
}
|
||||
// LOGGER.info("活动数据处理-1,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
// now = TimeUtils.now();
|
||||
SuperBoxEvent superBox = (SuperBoxEvent) event;
|
||||
// LOGGER.info("活动数据处理-2,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
// now = TimeUtils.now();
|
||||
User user = UserManager.getUser(superBox.getUserId());
|
||||
// LOGGER.info("活动数据处理-3,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
// now = TimeUtils.now();
|
||||
int goodId = superBox.getGiftId();
|
||||
// LOGGER.info("活动数据处理-4,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
// now = TimeUtils.now();
|
||||
// 不同状态礼包信息
|
||||
if (goodId == SuperBoxEvent.zero_init){
|
||||
zeroUpdate(user);
|
||||
// LOGGER.info("活动数据处理-5,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
// now = TimeUtils.now();
|
||||
}else {
|
||||
goodUpdate(user, goodId);
|
||||
// LOGGER.info("活动数据处理-6,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
// now = TimeUtils.now();
|
||||
}
|
||||
// 状态推送
|
||||
sendActivityProgress(user, null);
|
||||
|
|
@ -88,18 +100,30 @@ class NewRechargeSumDayActivity extends AbstractActivity {
|
|||
* @param goodId
|
||||
*/
|
||||
private void goodUpdate(User user, int goodId){
|
||||
long now = TimeUtils.now();
|
||||
if (goodId <= 0){
|
||||
return;
|
||||
}
|
||||
LOGGER.info("活动数据处理1,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
now = TimeUtils.now();
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
LOGGER.info("活动数据处理2,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
now = TimeUtils.now();
|
||||
// 表示已购买今天的礼包
|
||||
if (mission == null || mission.getV() == 1){
|
||||
return;
|
||||
}
|
||||
LOGGER.info("活动数据处理3,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
now = TimeUtils.now();
|
||||
List<SActivityRewardConfig> rewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||
LOGGER.info("活动数据处理4,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
now = TimeUtils.now();
|
||||
// 奖励按天数排序
|
||||
List<SActivityRewardConfig> list = rewardConfigs.stream().sorted(Comparator.comparing(SActivityRewardConfig::getSort)).collect(Collectors.toList());
|
||||
LOGGER.info("活动数据处理5,超值返利活动:{},size:{},耗时:{}",id, list.size(), TimeUtils.now()-now);
|
||||
now = TimeUtils.now();
|
||||
for (SActivityRewardConfig config : list) {
|
||||
now = TimeUtils.now();
|
||||
// null礼包表示没有买的礼包
|
||||
ActivityProgressInfo info = mission.getActivityMissionMap().get(config.getId());
|
||||
if (info == null){
|
||||
|
|
@ -113,7 +137,9 @@ class NewRechargeSumDayActivity extends AbstractActivity {
|
|||
}
|
||||
break;
|
||||
}
|
||||
LOGGER.info("活动数据处理6,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
}
|
||||
LOGGER.info("活动数据处理7,超值返利活动:{},耗时:{}",id, TimeUtils.now()-now);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ public class DynamicLRUCache<K, V> {
|
|||
if (cache.size() >= maxSize && maxSize < Integer.MAX_VALUE / 2) {
|
||||
maxSize *= 2; // 控制最大扩容限制
|
||||
}
|
||||
cache.put(key, new TimedCacheEntry<>(value));
|
||||
TimedCacheEntry<V> entry = new TimedCacheEntry<>(value);
|
||||
cache.put(key, entry);
|
||||
} finally {
|
||||
lock.writeLock().unlock();
|
||||
}
|
||||
|
|
@ -83,10 +84,13 @@ public class DynamicLRUCache<K, V> {
|
|||
// lock.readLock().lock();
|
||||
try {
|
||||
List<V> values = new ArrayList<>();
|
||||
for (TimedCacheEntry<V> entry : cache.values()) {
|
||||
if (!isEntryExpired(entry)) {
|
||||
values.add(entry.value);
|
||||
for (Map.Entry<K, TimedCacheEntry<V>> entry : cache.entrySet()) {
|
||||
K key = entry.getKey();
|
||||
TimedCacheEntry<V> value = entry.getValue();
|
||||
if (!isEntryExpired(value)) {
|
||||
values.add(value.value);
|
||||
}
|
||||
LOGGER.info("用户缓存全部,key:{},value:{}",key.hashCode(), values.hashCode());
|
||||
}
|
||||
return values;
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Reference in New Issue