Java Code Examples for org.apache.nifi.groups.ProcessGroup#getCounts()
The following examples show how to use
org.apache.nifi.groups.ProcessGroup#getCounts() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ControllerFacade.java From localization_nifi with Apache License 2.0 | 6 votes |
/** * Gets the status of this controller. * * @return the status of this controller */ public ControllerStatusDTO getControllerStatus() { final ProcessGroup rootGroup = flowController.getGroup(flowController.getRootGroupId()); final QueueSize controllerQueueSize = flowController.getTotalFlowFileCount(rootGroup); final ControllerStatusDTO controllerStatus = new ControllerStatusDTO(); controllerStatus.setActiveThreadCount(flowController.getActiveThreadCount()); controllerStatus.setQueued(FormatUtils.formatCount(controllerQueueSize.getObjectCount()) + " / " + FormatUtils.formatDataSize(controllerQueueSize.getByteCount())); controllerStatus.setBytesQueued(controllerQueueSize.getByteCount()); controllerStatus.setFlowFilesQueued(controllerQueueSize.getObjectCount()); final ProcessGroupCounts counts = rootGroup.getCounts(); controllerStatus.setRunningCount(counts.getRunningCount()); controllerStatus.setStoppedCount(counts.getStoppedCount()); controllerStatus.setInvalidCount(counts.getInvalidCount()); controllerStatus.setDisabledCount(counts.getDisabledCount()); controllerStatus.setActiveRemotePortCount(counts.getActiveRemotePortCount()); controllerStatus.setInactiveRemotePortCount(counts.getInactiveRemotePortCount()); return controllerStatus; }
Example 2
Source File: DtoFactory.java From localization_nifi with Apache License 2.0 | 5 votes |
/** * Creates a ProcessGroupDTO from the specified ProcessGroup. * * @param group group * @return dto */ private ProcessGroupDTO createConciseProcessGroupDto(final ProcessGroup group) { if (group == null) { return null; } final ProcessGroupDTO dto = new ProcessGroupDTO(); dto.setId(group.getIdentifier()); dto.setPosition(createPositionDto(group.getPosition())); dto.setComments(group.getComments()); dto.setName(group.getName()); final ProcessGroup parentGroup = group.getParent(); if (parentGroup != null) { dto.setParentGroupId(parentGroup.getIdentifier()); } final ProcessGroupCounts counts = group.getCounts(); dto.setRunningCount(counts.getRunningCount()); dto.setStoppedCount(counts.getStoppedCount()); dto.setInvalidCount(counts.getInvalidCount()); dto.setDisabledCount(counts.getDisabledCount()); dto.setInputPortCount(counts.getInputPortCount()); dto.setOutputPortCount(counts.getOutputPortCount()); dto.setActiveRemotePortCount(counts.getActiveRemotePortCount()); dto.setInactiveRemotePortCount(counts.getInactiveRemotePortCount()); return dto; }
Example 3
Source File: ControllerFacade.java From nifi with Apache License 2.0 | 5 votes |
/** * Gets the status of this controller. * * @return the status of this controller */ public ControllerStatusDTO getControllerStatus() { final ProcessGroup rootGroup = getRootGroup(); final GroupStatusCounts groupStatusCounts = flowController.getGroupStatusCounts(rootGroup); final ControllerStatusDTO controllerStatus = new ControllerStatusDTO(); controllerStatus.setActiveThreadCount(groupStatusCounts.getActiveThreadCount()); controllerStatus.setTerminatedThreadCount(groupStatusCounts.getTerminatedThreadCount()); controllerStatus.setQueued(FormatUtils.formatCount(groupStatusCounts.getQueuedCount()) + " / " + FormatUtils.formatDataSize(groupStatusCounts.getQueuedContentSize())); controllerStatus.setBytesQueued(groupStatusCounts.getQueuedContentSize()); controllerStatus.setFlowFilesQueued(groupStatusCounts.getQueuedCount()); final ProcessGroupCounts counts = rootGroup.getCounts(); controllerStatus.setRunningCount(counts.getRunningCount()); controllerStatus.setStoppedCount(counts.getStoppedCount()); controllerStatus.setInvalidCount(counts.getInvalidCount()); controllerStatus.setDisabledCount(counts.getDisabledCount()); controllerStatus.setActiveRemotePortCount(counts.getActiveRemotePortCount()); controllerStatus.setInactiveRemotePortCount(counts.getInactiveRemotePortCount()); controllerStatus.setUpToDateCount(counts.getUpToDateCount()); controllerStatus.setLocallyModifiedCount(counts.getLocallyModifiedCount()); controllerStatus.setStaleCount(counts.getStaleCount()); controllerStatus.setLocallyModifiedAndStaleCount(counts.getLocallyModifiedAndStaleCount()); controllerStatus.setSyncFailureCount(counts.getSyncFailureCount()); return controllerStatus; }
Example 4
Source File: FlowConfigurationDiagnosticTask.java From nifi with Apache License 2.0 | 5 votes |
@Override public DiagnosticsDumpElement captureDump(final boolean verbose) { final List<String> details = new ArrayList<>(); final ProcessGroup rootGroup = flowController.getFlowManager().getRootGroup(); final FlowController.GroupStatusCounts statusCounts = flowController.getGroupStatusCounts(rootGroup); details.add("Active Thread Count: " + statusCounts.getActiveThreadCount()); details.add("Terminated Thread Count: " + statusCounts.getTerminatedThreadCount()); details.add("Queued FlowFiles: " + statusCounts.getQueuedCount()); details.add("Queued Bytes: " + statusCounts.getQueuedContentSize()); final ProcessGroupCounts counts = rootGroup.getCounts(); details.add("Running Components: " + counts.getRunningCount()); details.add("Stopped Components: " + counts.getStoppedCount()); details.add("Invalid Components: " + counts.getInvalidCount()); details.add("Disabled Components: " + counts.getDisabledCount()); details.add("Local Input Ports: " + counts.getLocalInputPortCount()); details.add("Local Output Ports: " + counts.getLocalOutputPortCount()); details.add("Site-to-Site Input Ports: " + counts.getPublicInputPortCount()); details.add("Site-to-Site Input Ports: " + counts.getPublicOutputPortCount()); details.add("Active RPG Ports: " + counts.getActiveRemotePortCount()); details.add("Inactive RPG Ports: " + counts.getInactiveRemotePortCount()); details.add(""); details.add("Total Process Groups: " + rootGroup.findAllProcessGroups().size()); details.add("Locally Modified and Stale Count: " + counts.getLocallyModifiedAndStaleCount()); details.add("Locally Modified Count: " + counts.getLocallyModifiedCount()); details.add("Stale Count: " + counts.getStaleCount()); details.add("Sync Failure Count: " + counts.getSyncFailureCount()); details.add("Up-to-Date Count: " + counts.getUpToDateCount()); return new StandardDiagnosticsDumpElement("Flow Configuration", details); }