Github user markap14 commented on a diff in the pull request: https://github.com/apache/nifi/pull/2468#discussion_r174576032 --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java --- @@ -626,6 +634,132 @@ public static void merge(final SystemDiagnosticsSnapshotDTO target, final System updatePrettyPrintedFields(target); } + public static void merge(final JVMDiagnosticsSnapshotDTO target, final JVMDiagnosticsSnapshotDTO toMerge, final long numMillis) { + if (target == null || toMerge == null) { + return; + } + + if (toMerge.getControllerDiagnostics() == null) { + target.setControllerDiagnostics(null); + } else { + merge(target.getControllerDiagnostics(), toMerge.getControllerDiagnostics()); + } + + if (toMerge.getFlowDiagnosticsDto() == null) { + target.setFlowDiagnosticsDto(null); + } else { + merge(target.getFlowDiagnosticsDto(), toMerge.getFlowDiagnosticsDto()); + } + + if (toMerge.getSystemDiagnosticsDto() == null) { + target.setSystemDiagnosticsDto(null); + } else { + merge(target.getSystemDiagnosticsDto(), toMerge.getSystemDiagnosticsDto(), numMillis); + } + } + + private static void merge(final JVMControllerDiagnosticsSnapshotDTO target, final JVMControllerDiagnosticsSnapshotDTO toMerge) { + if (toMerge == null || target == null) { + return; + } + + target.setMaxEventDrivenThreads(add(target.getMaxEventDrivenThreads(), toMerge.getMaxEventDrivenThreads())); + target.setMaxTimerDrivenThreads(add(target.getMaxTimerDrivenThreads(), toMerge.getMaxTimerDrivenThreads())); --- End diff -- I think so - can imagine it being helpful to see how many threads are available across the cluster.
---