use of io.zeebe.util.sched.clock.ActorClock in project zeebe by zeebe-io.
the class MetricsFileWriter method dump.
private void dump() {
final ActorClock clock = ActorClock.current();
clock.update();
final int length = metricsManager.dump(writeBuffer, 0, clock.getTimeMillis());
final ByteBuffer inBuffer = writeBuffer.byteBuffer();
inBuffer.position(0);
inBuffer.limit(length);
try {
fileChannel.position(0);
fileChannel.truncate(length);
while (inBuffer.hasRemaining()) {
fileChannel.write(inBuffer);
}
fileChannel.force(false);
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations