private void updateDisplays() { // XY Plot final long timeStampDeltaInSeconds = (System.currentTimeMillis() - this.timeStampOfInitialization) / 1000; this.xyPlot.setEntry("", timeStampDeltaInSeconds, this.counter.get()); // Plain text this.plainText.setText(Long.toString(this.counter.get())); }
private void updateDisplays() { // XY Plot final long timeStampDeltaInSeconds = (System.currentTimeMillis() - this.timeStampOfInitialization) / 1000; this.xyPlot.setEntry("", timeStampDeltaInSeconds, this.counter.get()); // Plain text this.plainText.setText(Long.toString(this.counter.get())); }
private void updateDisplays() { // XY Plot final long timeStampDeltaInSeconds = (System.currentTimeMillis() - this.timeStampOfInitialization) / 1000; this.xyPlot.setEntry("", timeStampDeltaInSeconds, this.counter.get()); // Plain text this.plainText.setText(Long.toString(this.counter.get())); }
@InputPort(name = INPUT_PORT_NAME_TIME, eventTypes = { Long.class }, description = "Receives timestamps to calculate the throughput") public final void inputTime(final Long timestamp) { final long count = this.counter.getAndSet(0); final long duration = timestamp - this.lastTimestamp; final StringBuilder sb = new StringBuilder(256); sb.append(count).append(" objects within ").append(duration).append(' '). append(super.recordsTimeUnitFromProjectContext.toString()); this.plainTextDisplayObject.setText(sb.toString()); super.deliver(OUTPUT_PORT_NAME_THROUGHPUT, count); this.lastTimestamp = timestamp; }
@InputPort(name = INPUT_PORT_NAME_TIME, eventTypes = { Long.class }, description = "Receives timestamps to calculate the throughput") public final void inputTime(final Long timestamp) { final long count = this.counter.getAndSet(0); final long duration = timestamp - this.lastTimestamp; final StringBuilder sb = new StringBuilder(256); sb.append(count); sb.append(" objects within "); sb.append(duration); sb.append(' '); sb.append(super.recordsTimeUnitFromProjectContext.toString()); this.plainTextDisplayObject.setText(sb.toString()); super.deliver(OUTPUT_PORT_NAME_THROUGHPUT, count); this.lastTimestamp = timestamp; }
@Override protected void execute() { final IMonitoringRecord record = this.recordsInputPort.receive(); if (record != null) { this.numPassedElements++; this.recordsOutputPort.send(record); } final Long timestampInNs = this.timestampsInputPort.receive(); if (timestampInNs != null) { final long duration = timestampInNs - this.lastTimestampInNs; final StringBuilder sb = new StringBuilder(256).append(this.numPassedElements).append(" objects within ") .append(duration).append(' ').append(TimeUnit.NANOSECONDS.toString()); this.plainTextDisplayObject.setText(sb.toString()); this.recordsCountOutputPort.send(this.numPassedElements); this.resetTimestamp(timestampInNs); } }