public void start() { DateTime now = DateTime.now(); executionStartTime.compareAndSet(null, now); startNanos.compareAndSet(0, System.nanoTime()); startFullGcCount.compareAndSet(-1, gcMonitor.getMajorGcCount()); startFullGcTimeNanos.compareAndSet(-1, gcMonitor.getMajorGcTime().roundTo(NANOSECONDS)); // always update last execution start time lastExecutionStartTime.set(now); }
public Duration getFullGcTime() { long startFullGcTimeNanos = this.startFullGcTimeNanos.get(); if (startFullGcTimeNanos < 0) { return new Duration(0, MILLISECONDS); } long endFullGcTimeNanos = this.endFullGcTimeNanos.get(); if (endFullGcTimeNanos < 0) { endFullGcTimeNanos = gcMonitor.getMajorGcTime().roundTo(NANOSECONDS); } return new Duration(max(0, endFullGcTimeNanos - startFullGcTimeNanos), NANOSECONDS); }
public int getFullGcCount() { long startFullGcCount = this.startFullGcCount.get(); if (startFullGcCount < 0) { return 0; } long endFullGcCount = this.endFullGcCount.get(); if (endFullGcCount <= 0) { endFullGcCount = gcMonitor.getMajorGcCount(); } return toIntExact(max(0, endFullGcCount - startFullGcCount)); }
public Duration getFullGcTime() { long startFullGcTimeNanos = this.startFullGcTimeNanos.get(); if (startFullGcTimeNanos < 0) { return new Duration(0, MILLISECONDS); } long endFullGcTimeNanos = this.endFullGcTimeNanos.get(); if (endFullGcTimeNanos < 0) { endFullGcTimeNanos = gcMonitor.getMajorGcTime().roundTo(NANOSECONDS); } return new Duration(max(0, endFullGcTimeNanos - startFullGcTimeNanos), NANOSECONDS); }
public int getFullGcCount() { long startFullGcCount = this.startFullGcCount.get(); if (startFullGcCount < 0) { return 0; } long endFullGcCount = this.endFullGcCount.get(); if (endFullGcCount <= 0) { endFullGcCount = gcMonitor.getMajorGcCount(); } return toIntExact(max(0, endFullGcCount - startFullGcCount)); }
private void updateStatsIfDone(TaskState newState) { if (newState.isDone()) { DateTime now = DateTime.now(); long majorGcCount = gcMonitor.getMajorGcCount(); long majorGcTime = gcMonitor.getMajorGcTime().roundTo(NANOSECONDS); // before setting the end times, make sure a start has been recorded executionStartTime.compareAndSet(null, now); startNanos.compareAndSet(0, System.nanoTime()); startFullGcCount.compareAndSet(-1, majorGcCount); startFullGcTimeNanos.compareAndSet(-1, majorGcTime); // Only update last start time, if the nothing was started lastExecutionStartTime.compareAndSet(null, now); // use compare and set from initial value to avoid overwriting if there // were a duplicate notification, which shouldn't happen executionEndTime.compareAndSet(null, now); endNanos.compareAndSet(0, System.nanoTime()); endFullGcCount.compareAndSet(-1, majorGcCount); endFullGcTimeNanos.compareAndSet(-1, majorGcTime); } }
public Duration getFullGcTime() { long startFullGcTimeNanos = this.startFullGcTimeNanos.get(); if (startFullGcTimeNanos < 0) { return new Duration(0, MILLISECONDS); } long endFullGcTimeNanos = this.endFullGcTimeNanos.get(); if (endFullGcTimeNanos < 0) { endFullGcTimeNanos = gcMonitor.getMajorGcTime().roundTo(NANOSECONDS); } return new Duration(max(0, endFullGcTimeNanos - startFullGcTimeNanos), NANOSECONDS); }
public int getFullGcCount() { long startFullGcCount = this.startFullGcCount.get(); if (startFullGcCount < 0) { return 0; } long endFullGcCount = this.endFullGcCount.get(); if (endFullGcCount <= 0) { endFullGcCount = gcMonitor.getMajorGcCount(); } return toIntExact(max(0, endFullGcCount - startFullGcCount)); }
public void start() { DateTime now = DateTime.now(); executionStartTime.compareAndSet(null, now); startNanos.compareAndSet(0, System.nanoTime()); startFullGcCount.compareAndSet(-1, gcMonitor.getMajorGcCount()); startFullGcTimeNanos.compareAndSet(-1, gcMonitor.getMajorGcTime().roundTo(NANOSECONDS)); // always update last execution start time lastExecutionStartTime.set(now); }
public void start() { DateTime now = DateTime.now(); executionStartTime.compareAndSet(null, now); startNanos.compareAndSet(0, System.nanoTime()); startFullGcCount.compareAndSet(-1, gcMonitor.getMajorGcCount()); startFullGcTimeNanos.compareAndSet(-1, gcMonitor.getMajorGcTime().roundTo(NANOSECONDS)); // always update last execution start time lastExecutionStartTime.set(now); }
private void updateStatsIfDone(TaskState newState) { if (newState.isDone()) { DateTime now = DateTime.now(); long majorGcCount = gcMonitor.getMajorGcCount(); long majorGcTime = gcMonitor.getMajorGcTime().roundTo(NANOSECONDS); // before setting the end times, make sure a start has been recorded executionStartTime.compareAndSet(null, now); startNanos.compareAndSet(0, System.nanoTime()); startFullGcCount.compareAndSet(-1, majorGcCount); startFullGcTimeNanos.compareAndSet(-1, majorGcTime); // Only update last start time, if the nothing was started lastExecutionStartTime.compareAndSet(null, now); // use compare and set from initial value to avoid overwriting if there // were a duplicate notification, which shouldn't happen executionEndTime.compareAndSet(null, now); endNanos.compareAndSet(0, System.nanoTime()); endFullGcCount.compareAndSet(-1, majorGcCount); endFullGcTimeNanos.compareAndSet(-1, majorGcTime); } }
private void updateStatsIfDone(TaskState newState) { if (newState.isDone()) { DateTime now = DateTime.now(); long majorGcCount = gcMonitor.getMajorGcCount(); long majorGcTime = gcMonitor.getMajorGcTime().roundTo(NANOSECONDS); // before setting the end times, make sure a start has been recorded executionStartTime.compareAndSet(null, now); startNanos.compareAndSet(0, System.nanoTime()); startFullGcCount.compareAndSet(-1, majorGcCount); startFullGcTimeNanos.compareAndSet(-1, majorGcTime); // Only update last start time, if the nothing was started lastExecutionStartTime.compareAndSet(null, now); // use compare and set from initial value to avoid overwriting if there // were a duplicate notification, which shouldn't happen executionEndTime.compareAndSet(null, now); endNanos.compareAndSet(0, System.nanoTime()); endFullGcCount.compareAndSet(-1, majorGcCount); endFullGcTimeNanos.compareAndSet(-1, majorGcTime); } }