onlineUserReport五分钟上报修改
parent
33bcd9be80
commit
7331168ef5
|
@ -310,8 +310,7 @@ public class BuyGoodsNewLogic {
|
|||
rechargeEvent.setModule("GameAnalysis");
|
||||
rechargeEvent.setIp("");
|
||||
rechargeEvent.setName("charge");
|
||||
//rechargeEvent.setIndex(GameApplication.serverProperties.getAppId()==null?"APPID":GameApplication.serverProperties.getAppId());
|
||||
rechargeEvent.setIndex("98k3j3yxkb8ux2zj");
|
||||
rechargeEvent.setIndex(GameApplication.serverProperties.getAppId()==null?"APPID":GameApplication.serverProperties.getAppId());
|
||||
rechargeEvent.setIdentify(String.valueOf(user.getPlayerInfoManager().getOpenId()));
|
||||
rechargeEvent.setProperties(new RechargeEventProp(orderId,amount*100,virtualAmount,currency_type,"",""));
|
||||
String s = DataMessageUtils.sendRechargePost(rechargeEvent);
|
||||
|
|
|
@ -29,7 +29,7 @@ public class ThreadManager implements IManager {
|
|||
private static MongoDataHandlerTask mongoDataHandlerTask;
|
||||
private static ItemLogTask itemLogTask;
|
||||
public static int SLEEP_INTEVAL_TIME = 60; //每1分钟检查一次
|
||||
private static OnlineUserTapTask onlineUserTapTask;//5分钟上报一次
|
||||
//private static OnlineUserTapTask onlineUserTapTask;//5分钟上报一次
|
||||
|
||||
private static Set<Future<?>> scheduledFutureSets = new HashSet<>();
|
||||
|
||||
|
@ -42,13 +42,13 @@ public class ThreadManager implements IManager {
|
|||
mongoDataHandlerTask = ConfigurableApplicationContextManager.getBean(MongoDataHandlerTask.class);
|
||||
dataReportTask = ConfigurableApplicationContextManager.getBean(DataReportTask.class);
|
||||
itemLogTask = ConfigurableApplicationContextManager.getBean(ItemLogTask.class);
|
||||
onlineUserTapTask = ConfigurableApplicationContextManager.getBean(OnlineUserTapTask.class);
|
||||
//onlineUserTapTask = ConfigurableApplicationContextManager.getBean(OnlineUserTapTask.class);
|
||||
|
||||
new RetrySendIndicationThread("retry-indi").start();
|
||||
mongoDataHandlerTask.start();
|
||||
dataReportTask.start();
|
||||
itemLogTask.start();
|
||||
onlineUserTapTask.start();
|
||||
//onlineUserTapTask.start();
|
||||
|
||||
scheduledExecutor = new ScheduledThreadPoolExecutor(8, new ScheduleThreadFactory());
|
||||
scheduledExecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package com.ljsd.jieling.thread.task;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.config.reportData.DataMessageUtils;
|
||||
import com.ljsd.jieling.ktbeans.OnlineProp;
|
||||
import com.ljsd.jieling.ktbeans.OnlineUserCalEvent;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.ktbeans.sendbeans.ReportServerEvent;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
|
@ -8,7 +11,7 @@ import com.ljsd.jieling.logic.dao.UserManager;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import util.TimeUtils;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -30,6 +33,16 @@ public class OnlineUserReportTask extends Thread {
|
|||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
//5分钟上报一次
|
||||
if(TimeUtils.getMiunte()%5 == 0){
|
||||
int serverId = GameApplication.serverId;
|
||||
Set<Integer> uids = OnlineUserManager.sessionMap.keySet();
|
||||
OnlineUserCalEvent onlineUserCalEvent = new OnlineUserCalEvent();
|
||||
onlineUserCalEvent.setAppid(GameApplication.serverProperties.getAppId()==null?"APPID":GameApplication.serverProperties.getAppId());
|
||||
onlineUserCalEvent.setOnlines(new OnlineProp[]{new OnlineProp(String.valueOf(serverId),uids.size(), TimeUtils.now()/1000)});
|
||||
DataMessageUtils.sendOnlinePost(onlineUserCalEvent);
|
||||
}
|
||||
|
||||
Set<Integer> uids = OnlineUserManager.sessionMap.keySet();
|
||||
Map<String,Integer> channelMap = new HashMap<>();
|
||||
for(int uid:uids){
|
||||
|
|
Loading…
Reference in New Issue