@Override public Integer value() { final ProcessGroupStatus status = latestStatus.get(); if (status == null) { return 0; } final Integer value = status.getQueuedCount(); return (value == null) ? 0 : value; } });
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; }
if (controllerStatus.getQueuedCount() <= 0) { break; logger.debug("Offloading queues on node {}, remaining queued count: {}", getNodeId(), controllerStatus.getQueuedCount()); Thread.sleep(1000);
target.setOutputCount(target.getOutputCount() + toMerge.getOutputCount()); target.setOutputContentSize(target.getOutputContentSize() + toMerge.getOutputContentSize()); target.setQueuedCount(target.getQueuedCount() + toMerge.getQueuedCount()); target.setQueuedContentSize(target.getQueuedContentSize() + toMerge.getQueuedContentSize()); target.setBytesRead(target.getBytesRead() + toMerge.getBytesRead());
snapshot.setFlowFilesQueued(processGroupStatus.getQueuedCount()); snapshot.setBytesQueued(processGroupStatus.getQueuedContentSize()); snapshot.setBytesRead(processGroupStatus.getBytesRead());
bytesRead += childGroupStatus.getBytesRead(); bytesWritten += childGroupStatus.getBytesWritten(); queuedCount += childGroupStatus.getQueuedCount(); queuedContentSize += childGroupStatus.getQueuedContentSize();
addField(builder, "queuedContentSize", status.getQueuedContentSize()); addField(builder, "activeThreadCount", status.getActiveThreadCount()); addField(builder, "queuedCount", status.getQueuedCount());
InstanceHealth instanceHealth = new InstanceHealth(); instanceHealth.setQueuedCount(rootGroupStatus.getQueuedCount()); instanceHealth.setQueuedContentSize(rootGroupStatus.getQueuedContentSize()); instanceHealth.setHasBulletins(!bulletinList.isEmpty());
addField(builder, "queuedContentSize", status.getQueuedContentSize()); addField(builder, "activeThreadCount", status.getActiveThreadCount()); addField(builder, "queuedCount", status.getQueuedCount());