Java Code Examples for org.apache.nifi.controller.status.ProcessorStatus#getProcessingNanos()
The following examples show how to use
org.apache.nifi.controller.status.ProcessorStatus#getProcessingNanos() .
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: StandardGangliaReporter.java From localization_nifi with Apache License 2.0 | 5 votes |
private long calculateProcessingNanos(final ProcessGroupStatus status) { long nanos = 0L; for (final ProcessorStatus procStats : status.getProcessorStatus()) { nanos += procStats.getProcessingNanos(); } for (final ProcessGroupStatus childGroupStatus : status.getProcessGroupStatus()) { nanos += calculateProcessingNanos(childGroupStatus); } return nanos; }
Example 2
Source File: MetricsService.java From localization_nifi with Apache License 2.0 | 5 votes |
protected long calculateProcessingNanos(final ProcessGroupStatus status) { long nanos = 0L; for (final ProcessorStatus procStats : status.getProcessorStatus()) { nanos += procStats.getProcessingNanos(); } for (final ProcessGroupStatus childGroupStatus : status.getProcessGroupStatus()) { nanos += calculateProcessingNanos(childGroupStatus); } return nanos; }
Example 3
Source File: MetricsService.java From localization_nifi with Apache License 2.0 | 5 votes |
protected long calculateProcessingNanos(final ProcessGroupStatus status) { long nanos = 0L; for (final ProcessorStatus procStats : status.getProcessorStatus()) { nanos += procStats.getProcessingNanos(); } for (final ProcessGroupStatus childGroupStatus : status.getProcessGroupStatus()) { nanos += calculateProcessingNanos(childGroupStatus); } return nanos; }
Example 4
Source File: MetricsService.java From nifi-prometheus-reporter with Apache License 2.0 | 5 votes |
protected long calculateProcessingNanos(final ProcessGroupStatus status) { long nanos = 0L; for (final ProcessorStatus procStats : status.getProcessorStatus()) { nanos += procStats.getProcessingNanos(); } for (final ProcessGroupStatus childGroupStatus : status.getProcessGroupStatus()) { nanos += calculateProcessingNanos(childGroupStatus); } return nanos; }
Example 5
Source File: AzureLogAnalyticsMetricsFactory.java From nifi with Apache License 2.0 | 5 votes |
static long calculateProcessingNanos(final ProcessGroupStatus status) { long nanos = 0L; for (final ProcessorStatus procStats : status.getProcessorStatus()) { nanos += procStats.getProcessingNanos(); } for (final ProcessGroupStatus childGroupStatus : status.getProcessGroupStatus()) { nanos += calculateProcessingNanos(childGroupStatus); } return nanos; }
Example 6
Source File: MetricsService.java From nifi with Apache License 2.0 | 5 votes |
protected long calculateProcessingNanos(final ProcessGroupStatus status) { long nanos = 0L; for (final ProcessorStatus procStats : status.getProcessorStatus()) { nanos += procStats.getProcessingNanos(); } for (final ProcessGroupStatus childGroupStatus : status.getProcessGroupStatus()) { nanos += calculateProcessingNanos(childGroupStatus); } return nanos; }
Example 7
Source File: StandardGangliaReporter.java From nifi with Apache License 2.0 | 5 votes |
private long calculateProcessingNanos(final ProcessGroupStatus status) { long nanos = 0L; for (final ProcessorStatus procStats : status.getProcessorStatus()) { nanos += procStats.getProcessingNanos(); } for (final ProcessGroupStatus childGroupStatus : status.getProcessGroupStatus()) { nanos += calculateProcessingNanos(childGroupStatus); } return nanos; }
Example 8
Source File: FlowMetricSet.java From nifi with Apache License 2.0 | 5 votes |
/** * Calculate the total processing time of a process group. * * @param status the current process group status. * @return the total amount of nanoseconds spent in each processor in the process group. */ private long calculateProcessingNanos(final ProcessGroupStatus status) { long nanos = 0L; for (final ProcessorStatus procStats : status.getProcessorStatus()) { nanos += procStats.getProcessingNanos(); } for (final ProcessGroupStatus childGroupStatus : status.getProcessGroupStatus()) { nanos += calculateProcessingNanos(childGroupStatus); } return nanos; }
Example 9
Source File: MetricsService.java From nifi with Apache License 2.0 | 5 votes |
protected long calculateProcessingNanos(final ProcessGroupStatus status) { long nanos = 0L; for (final ProcessorStatus procStats : status.getProcessorStatus()) { nanos += procStats.getProcessingNanos(); } for (final ProcessGroupStatus childGroupStatus : status.getProcessGroupStatus()) { nanos += calculateProcessingNanos(childGroupStatus); } return nanos; }
Example 10
Source File: ControllerStatusReportingTask.java From localization_nifi with Apache License 2.0 | 4 votes |
private void printProcessorStatus(final ProcessGroupStatus groupStatus, final StringBuilder builder, final boolean showDeltas) { final List<ProcessorStatus> processorStatuses = new ArrayList<>(); populateProcessorStatuses(groupStatus, processorStatuses); Collections.sort(processorStatuses, new Comparator<ProcessorStatus>() { @Override public int compare(final ProcessorStatus o1, final ProcessorStatus o2) { if (o1 == null && o2 == null) { return 0; } if (o1 == null) { return 1; } if (o2 == null) { return -1; } return -Long.compare(o1.getProcessingNanos(), o2.getProcessingNanos()); } }); for (final ProcessorStatus processorStatus : processorStatuses) { // get the stats final String input = processorStatus.getInputCount() + " / " + FormatUtils.formatDataSize(processorStatus.getInputBytes()); final String output = processorStatus.getOutputCount() + " / " + FormatUtils.formatDataSize(processorStatus.getOutputBytes()); final String read = FormatUtils.formatDataSize(processorStatus.getBytesRead()); final String written = FormatUtils.formatDataSize(processorStatus.getBytesWritten()); final String invocations = String.valueOf(processorStatus.getInvocations()); final long nanos = processorStatus.getProcessingNanos(); final String procTime = FormatUtils.formatHoursMinutesSeconds(nanos, TimeUnit.NANOSECONDS); String runStatus = ""; if (processorStatus.getRunStatus() != null) { runStatus = processorStatus.getRunStatus().toString(); } final String inputDiff; final String outputDiff; final String readDiff; final String writtenDiff; final String invocationsDiff; final String procTimeDiff; final ProcessorStatus lastStatus = lastProcessorStatus.get(processorStatus.getId()); if (showDeltas && lastStatus != null) { inputDiff = toDiff(lastStatus.getInputCount(), lastStatus.getInputBytes(), processorStatus.getInputCount(), processorStatus.getInputBytes()); outputDiff = toDiff(lastStatus.getOutputCount(), lastStatus.getOutputBytes(), processorStatus.getOutputCount(), processorStatus.getOutputBytes()); readDiff = toDiff(lastStatus.getBytesRead(), processorStatus.getBytesRead(), true, false); writtenDiff = toDiff(lastStatus.getBytesWritten(), processorStatus.getBytesWritten(), true, false); invocationsDiff = toDiff(lastStatus.getInvocations(), processorStatus.getInvocations()); procTimeDiff = toDiff(lastStatus.getProcessingNanos(), processorStatus.getProcessingNanos(), false, true); } else { inputDiff = toDiff(0L, 0L, processorStatus.getInputCount(), processorStatus.getInputBytes()); outputDiff = toDiff(0L, 0L, processorStatus.getOutputCount(), processorStatus.getOutputBytes()); readDiff = toDiff(0L, processorStatus.getBytesRead(), true, false); writtenDiff = toDiff(0L, processorStatus.getBytesWritten(), true, false); invocationsDiff = toDiff(0L, processorStatus.getInvocations()); procTimeDiff = toDiff(0L, processorStatus.getProcessingNanos(), false, true); } if (showDeltas) { builder.append(String.format(processorLineFormat, processorStatus.getName(), processorStatus.getId(), processorStatus.getType(), runStatus, input + inputDiff, output + outputDiff, read + readDiff, written + writtenDiff, invocations + invocationsDiff, procTime + procTimeDiff)); } else { builder.append(String.format(processorLineFormat, processorStatus.getName(), processorStatus.getId(), processorStatus.getType(), runStatus, input, output, read, written, invocations, procTime)); } lastProcessorStatus.put(processorStatus.getId(), processorStatus); } }
Example 11
Source File: ControllerStatusReportingTask.java From nifi with Apache License 2.0 | 4 votes |
private void printProcessorStatus(final ProcessGroupStatus groupStatus, final StringBuilder builder, final boolean showDeltas) { final List<ProcessorStatus> processorStatuses = new ArrayList<>(); populateProcessorStatuses(groupStatus, processorStatuses); Collections.sort(processorStatuses, new Comparator<ProcessorStatus>() { @Override public int compare(final ProcessorStatus o1, final ProcessorStatus o2) { if (o1 == null && o2 == null) { return 0; } if (o1 == null) { return 1; } if (o2 == null) { return -1; } return -Long.compare(o1.getProcessingNanos(), o2.getProcessingNanos()); } }); for (final ProcessorStatus processorStatus : processorStatuses) { // get the stats final String input = processorStatus.getInputCount() + " / " + FormatUtils.formatDataSize(processorStatus.getInputBytes()); final String output = processorStatus.getOutputCount() + " / " + FormatUtils.formatDataSize(processorStatus.getOutputBytes()); final String read = FormatUtils.formatDataSize(processorStatus.getBytesRead()); final String written = FormatUtils.formatDataSize(processorStatus.getBytesWritten()); final String invocations = String.valueOf(processorStatus.getInvocations()); final long nanos = processorStatus.getProcessingNanos(); final String procTime = FormatUtils.formatHoursMinutesSeconds(nanos, TimeUnit.NANOSECONDS); String runStatus = ""; if (processorStatus.getRunStatus() != null) { runStatus = processorStatus.getRunStatus().toString(); } final String inputDiff; final String outputDiff; final String readDiff; final String writtenDiff; final String invocationsDiff; final String procTimeDiff; final ProcessorStatus lastStatus = lastProcessorStatus.get(processorStatus.getId()); if (showDeltas && lastStatus != null) { inputDiff = toDiff(lastStatus.getInputCount(), lastStatus.getInputBytes(), processorStatus.getInputCount(), processorStatus.getInputBytes()); outputDiff = toDiff(lastStatus.getOutputCount(), lastStatus.getOutputBytes(), processorStatus.getOutputCount(), processorStatus.getOutputBytes()); readDiff = toDiff(lastStatus.getBytesRead(), processorStatus.getBytesRead(), true, false); writtenDiff = toDiff(lastStatus.getBytesWritten(), processorStatus.getBytesWritten(), true, false); invocationsDiff = toDiff(lastStatus.getInvocations(), processorStatus.getInvocations()); procTimeDiff = toDiff(lastStatus.getProcessingNanos(), processorStatus.getProcessingNanos(), false, true); } else { inputDiff = toDiff(0L, 0L, processorStatus.getInputCount(), processorStatus.getInputBytes()); outputDiff = toDiff(0L, 0L, processorStatus.getOutputCount(), processorStatus.getOutputBytes()); readDiff = toDiff(0L, processorStatus.getBytesRead(), true, false); writtenDiff = toDiff(0L, processorStatus.getBytesWritten(), true, false); invocationsDiff = toDiff(0L, processorStatus.getInvocations()); procTimeDiff = toDiff(0L, processorStatus.getProcessingNanos(), false, true); } if (showDeltas) { builder.append(String.format(processorLineFormat, processorStatus.getName(), processorStatus.getId(), processorStatus.getType(), runStatus, input + inputDiff, output + outputDiff, read + readDiff, written + writtenDiff, invocations + invocationsDiff, procTime + procTimeDiff)); } else { builder.append(String.format(processorLineFormat, processorStatus.getName(), processorStatus.getId(), processorStatus.getType(), runStatus, input, output, read, written, invocations, procTime)); } lastProcessorStatus.put(processorStatus.getId(), processorStatus); } }
Example 12
Source File: ProcessorStatusEnumerator.java From nifi with Apache License 2.0 | 4 votes |
private Object filterColumns(final ProcessorStatus status) { if (status == null) { return null; } final Object[] row = new Object[]{ status.getId(), status.getGroupId(), status.getName(), status.getType(), status.getAverageLineageDuration(TimeUnit.MILLISECONDS), status.getBytesRead(), status.getBytesWritten(), status.getBytesReceived(), status.getBytesSent(), status.getFlowFilesRemoved(), status.getFlowFilesReceived(), status.getFlowFilesSent(), status.getInputCount(), status.getInputBytes(), status.getOutputCount(), status.getOutputBytes(), status.getActiveThreadCount(), status.getTerminatedThreadCount(), status.getInvocations(), status.getProcessingNanos(), status.getRunStatus().name(), status.getExecutionNode() == null ? null : status.getExecutionNode().name() }; // If we want no fields just return null if (fields == null) { return row; } // If we want only a single field, then Calcite is going to expect us to return // the actual value, NOT a 1-element array of values. if (fields.length == 1) { final int desiredCellIndex = fields[0]; return row[desiredCellIndex]; } // Create a new Object array that contains only the desired fields. final Object[] filtered = new Object[fields.length]; for (int i = 0; i < fields.length; i++) { final int indexToKeep = fields[i]; filtered[i] = row[indexToKeep]; } return filtered; }