Browse Source

0.0.49
father依赖关系原来只增不减,改了

menglu 3 years ago
parent
commit
ac629cb625

+ 1 - 1
ibms-data-sdk/pom.xml

@@ -220,7 +220,7 @@
 		<dependency>
 			<groupId>com.persagy</groupId>
 			<artifactId>sailfish</artifactId>
-			<version>0.0.48</version>
+			<version>0.0.49</version>
 		</dependency>
 	</dependencies>
 

+ 7 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/RefreshThread.java

@@ -48,6 +48,7 @@ public class RefreshThread extends Thread {
 			}
 		}
 
+		Date lastPrintComputeQueueTime = new Date();
 		while (!stop) {
 			try {
 				Thread.sleep(1000L);
@@ -55,6 +56,12 @@ public class RefreshThread extends Thread {
 				log.error(e.getMessage(), e);
 			}
 
+			Date currTime = new Date();
+			if (currTime.getTime() / (1000L * 60) > lastPrintComputeQueueTime.getTime() / (1000L * 60)) {
+				log.warn("WaitCompute size: " + RepositoryContainer.instance.WaitCompute.size());
+				lastPrintComputeQueueTime = currTime;
+			}
+
 			boolean changed_config = false;
 			boolean changed_physical_world = false;
 			boolean changed_zkt_physical_world = false;

+ 1 - 3
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/RepositoryImpl.java

@@ -7,7 +7,6 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -342,8 +341,7 @@ public class RepositoryImpl extends RepositoryBase {
 			SceneDataValue sdv = this.ZKTObjectArrayDic.get(ibmsSceneCode).get(ibmsClassCode);
 			for (SceneDataObject obj : sdv.value_array.set) {
 				if (obj.father != null) {
-					this.dependency.sdv2Children.putIfAbsent(obj.father, new CopyOnWriteArrayList<SceneDataObject>());
-					this.dependency.sdv2Children.get(obj.father).add(obj);
+					this.dependency.membership_add(obj.father, obj);
 				}
 			}
 		}

+ 16 - 3
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/websocket/IOTWebSocketClient.java

@@ -54,6 +54,8 @@ public class IOTWebSocketClient extends WebSocketClient {
 
 	Date lastTime = new Date();
 	volatile int recent_count = 0;
+	volatile int recent_change_count = 0;
+	volatile int recent_affect_count = 0;
 
 	@Override
 	public void onMessage(String arg0) {
@@ -63,8 +65,11 @@ public class IOTWebSocketClient extends WebSocketClient {
 			Date currTime = new Date();
 			if (currTime.getTime() / (1000L * 60) != lastTime.getTime() / (1000L * 60)) {
 				lastTime = currTime;
-				log.warn("IOTWebSocketClient rece count: " + recent_count);
+				log.warn("IOTWebSocketClient recent_count: " + recent_count + " ,recent_change_count: " + recent_change_count
+						+ " ,recent_affect_count : " + recent_affect_count + " ");
 				recent_count = 0;
+				recent_change_count = 0;
+				recent_affect_count = 0;
 			}
 
 			JSONObject json = (JSONObject) JSON.parse(arg0);
@@ -122,7 +127,11 @@ public class IOTWebSocketClient extends WebSocketClient {
 							data.value = valueNew;
 							// 加入计算队列
 							if (!valueEqual) {
-								Repository.ProcessIOT(point);
+								recent_change_count++;
+								int affect_count = Repository.ProcessIOT(point);
+								if (affect_count > 0) {
+									recent_affect_count++;
+								}
 							}
 							// 检查是否子系统连接状态
 							if (meter.startsWith("subsystem_connect_status_")) {
@@ -220,7 +229,11 @@ public class IOTWebSocketClient extends WebSocketClient {
 						data.value = valueNew;
 						// 加入计算队列
 						if (!valueEqual) {
-							Repository.ProcessIOT(point);
+							recent_change_count++;
+							int affect_count = Repository.ProcessIOT(point);
+							if (affect_count > 0) {
+								recent_affect_count++;
+							}
 						}
 					} catch (Exception e) {
 						log.error(e.getMessage(), e);