@Override public Integer value() { final ProcessGroupStatus status = latestStatus.get(); if (status == null) { return 0; } return status.getFlowFilesSent(); } });
public Map<String, Double> getDataFlowMetrics(ProcessGroupStatus status) { final Map<String, Double> metrics = new HashMap<>(); metrics.put(MetricNames.FLOW_FILES_RECEIVED, new Double(status.getFlowFilesReceived())); metrics.put(MetricNames.BYTES_RECEIVED, new Double(status.getBytesReceived())); metrics.put(MetricNames.FLOW_FILES_SENT, new Double(status.getFlowFilesSent())); metrics.put(MetricNames.BYTES_SENT, new Double(status.getBytesSent())); metrics.put(MetricNames.FLOW_FILES_QUEUED, new Double(status.getQueuedCount())); metrics.put(MetricNames.BYTES_QUEUED, new Double(status.getQueuedContentSize())); metrics.put(MetricNames.BYTES_READ, new Double(status.getBytesRead())); metrics.put(MetricNames.BYTES_WRITTEN, new Double(status.getBytesWritten())); metrics.put(MetricNames.ACTIVE_THREADS, new Double(status.getActiveThreadCount())); metrics.put(MetricNames.TOTAL_TASK_DURATION, new Double(calculateProcessingNanos(status))); status.getOutputPortStatus(); return metrics; }
/** * Create a map of {@link Gauge}s for the {@link #currentStatusReference}. This methods reports the metrics as * found in the reference. * * @return map between the metric name and a {@link Gauge} to it's value. */ @Override public Map<String, Metric> getMetrics() { Map<String, Metric> metrics = new HashMap<>(); metrics.put(MetricNames.ACTIVE_THREADS, (Gauge<Integer>) () -> currentStatusReference.get().getActiveThreadCount()); metrics.put(MetricNames.BYTES_QUEUED, (Gauge<Long>) () -> currentStatusReference.get().getQueuedContentSize()); metrics.put(MetricNames.BYTES_READ, (Gauge<Long>) () -> currentStatusReference.get().getBytesRead()); metrics.put(MetricNames.BYTES_RECEIVED, (Gauge<Long>) () -> currentStatusReference.get().getBytesReceived()); metrics.put(MetricNames.BYTES_SENT, (Gauge<Long>) () -> currentStatusReference.get().getBytesSent()); metrics.put(MetricNames.BYTES_WRITTEN, (Gauge<Long>) () -> currentStatusReference.get().getBytesWritten()); metrics.put(MetricNames.FLOW_FILES_RECEIVED, (Gauge<Integer>) () -> currentStatusReference.get().getFlowFilesReceived()); metrics.put(MetricNames.FLOW_FILES_QUEUED, (Gauge<Integer>) () -> currentStatusReference.get().getQueuedCount()); metrics.put(MetricNames.FLOW_FILES_SENT, (Gauge<Integer>) () -> currentStatusReference.get().getFlowFilesSent()); metrics.put(MetricNames.TOTAL_TASK_DURATION_NANOS, (Gauge<Long>) () -> calculateProcessingNanos(currentStatusReference.get())); return metrics; }
private Map<String,Integer> getIntegerMetrics(ProcessGroupStatus status, boolean appendPgId) { final Map<String,Integer> metrics = new HashMap<>(); metrics.put(appendPgId(MetricNames.FLOW_FILES_RECEIVED, status, appendPgId), status.getFlowFilesReceived()); metrics.put(appendPgId(MetricNames.FLOW_FILES_SENT, status, appendPgId), status.getFlowFilesSent()); metrics.put(appendPgId(MetricNames.FLOW_FILES_QUEUED, status, appendPgId), status.getQueuedCount()); metrics.put(appendPgId(MetricNames.ACTIVE_THREADS, status, appendPgId), status.getActiveThreadCount()); return metrics; }
target.setFlowFilesReceived(target.getFlowFilesReceived() + toMerge.getFlowFilesReceived()); target.setBytesReceived(target.getBytesReceived() + toMerge.getBytesReceived()); target.setFlowFilesSent(target.getFlowFilesSent() + toMerge.getFlowFilesSent()); target.setBytesSent(target.getBytesSent() + toMerge.getBytesSent());
snapshot.setFlowFilesTransferred(processGroupStatus.getFlowFilesTransferred()); snapshot.setBytesTransferred(processGroupStatus.getBytesTransferred()); snapshot.setFlowFilesSent(processGroupStatus.getFlowFilesSent()); snapshot.setBytesSent(processGroupStatus.getBytesSent()); snapshot.setFlowFilesReceived(processGroupStatus.getFlowFilesReceived());
flowFilesSent += childGroupStatus.getFlowFilesSent(); bytesSent += childGroupStatus.getBytesSent();
addField(builder, "bytesTransferred", status.getBytesTransferred()); addField(builder, "flowFilesReceived", status.getFlowFilesReceived()); addField(builder, "flowFilesSent", status.getFlowFilesSent()); addField(builder, "flowFilesTransferred", status.getFlowFilesTransferred()); addField(builder, "inputContentSize", status.getInputContentSize());
instanceStats.setBytesWritten(rootGroupStatus.getBytesWritten()); instanceStats.setBytesSent(rootGroupStatus.getBytesSent()); instanceStats.setFlowfilesSent(rootGroupStatus.getFlowFilesSent()); instanceStats.setBytesTransferred(rootGroupStatus.getBytesTransferred()); instanceStats.setFlowfilesTransferred(rootGroupStatus.getFlowFilesTransferred());
addField(builder, "bytesTransferred", status.getBytesTransferred()); addField(builder, "flowFilesReceived", status.getFlowFilesReceived()); addField(builder, "flowFilesSent", status.getFlowFilesSent()); addField(builder, "flowFilesTransferred", status.getFlowFilesTransferred()); addField(builder, "inputContentSize", status.getInputContentSize());