public Date getKernelBootTime() {
return kernel.getBootTime();
}
public Stats getStats() {
BoundedRangeImpl heap;
if(stats == null) {
stats = new JVMStatsImpl();
long start = kernel.getBootTime().getTime();
stats.getUpTimeImpl().setCount(start);
stats.getUpTimeImpl().setStartTime(start);
heap = stats.getHeapSizeImpl();
heap.setStartTime(start);
heap.setBounds(0, runtime.totalMemory());
heap.setCurrent(heap.getUpperBound() - runtime.freeMemory());
heap.setLowWaterMark(heap.getCurrent());
heap.setHighWaterMark(heap.getCurrent());
} else {
heap = stats.getHeapSizeImpl();
heap.setBounds(0, runtime.totalMemory());
heap.setCurrent(heap.getUpperBound() - runtime.freeMemory());
}
long now = System.currentTimeMillis();
stats.getUpTimeImpl().setLastSampleTime(now);
heap.setLastSampleTime(now);
return stats;
}