| | |
| | | private static final int EXECUTOR_QUEUE_WARN_THRESHOLD = 20; |
| | | private static final int EXECUTOR_ACTIVE_WARN_THRESHOLD = 48; |
| | | private static final long SEGMENT_EXECUTE_WARN_MS = 10_000L; |
| | | private static final long COMMAND_BUILD_WARN_MS = 500L; |
| | | private static final int QUEUE_DRAIN_BATCH_SIZE = 32; |
| | | private static final long QUEUE_IDLE_SLEEP_MS = 20L; |
| | | |
| | |
| | | stationCommand.setCommandType(commandType); |
| | | |
| | | if (commandType == StationCommandType.MOVE && !stationId.equals(targetStationId)) { |
| | | long startNs = System.nanoTime(); |
| | | long calcPathStartNs = startNs; |
| | | List<NavigateNode> nodes = calcPathNavigateNodes(taskNo, stationId, targetStationId, pathLenFactor); |
| | | return fillMoveCommandPath(stationCommand, nodes, taskNo, stationId, targetStationId); |
| | | long calcPathCostMs = nanosToMillis(System.nanoTime() - calcPathStartNs); |
| | | long fillCommandStartNs = System.nanoTime(); |
| | | StationCommand builtCommand = fillMoveCommandPath(stationCommand, nodes, taskNo, stationId, targetStationId); |
| | | long fillCommandCostMs = nanosToMillis(System.nanoTime() - fillCommandStartNs); |
| | | long totalCostMs = nanosToMillis(System.nanoTime() - startNs); |
| | | if (totalCostMs >= COMMAND_BUILD_WARN_MS) { |
| | | log.warn("V5输送命令生成耗时较长,deviceNo={}, taskNo={}, stationId={}, targetStaNo={}, calcPath={}ms, fillCommand={}ms, total={}ms", |
| | | deviceConfig == null ? null : deviceConfig.getDeviceNo(), |
| | | taskNo, |
| | | stationId, |
| | | targetStationId, |
| | | calcPathCostMs, |
| | | fillCommandCostMs, |
| | | totalCostMs); |
| | | } |
| | | return builtCommand; |
| | | } |
| | | return stationCommand; |
| | | } |