de.schlichtherle.truezip.fs.inst.jmx.JmxIOStatistics Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truezip-extension-jmx-jul Show documentation
Show all versions of truezip-extension-jmx-jul Show documentation
This module provides a file system manager and an I/O pool service
for managing and monitoring TrueZIP via JMX and java.util.logging.
Add the JAR artifact of this module to the run time class path to
make its services available for service location in the client API
modules.
The newest version!
/*
* Copyright (C) 2005-2015 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package de.schlichtherle.truezip.fs.inst.jmx;
import javax.annotation.concurrent.ThreadSafe;
/**
* @author Christian Schlichtherle
*/
@ThreadSafe
final class JmxIOStatistics {
private final long time;
private volatile long read;
private volatile long written;
JmxIOStatistics() {
time = System.currentTimeMillis();
}
long getTimeCreatedMillis() {
return time;
}
long getBytesRead() {
return read;
}
synchronized void incBytesRead(int inc) {
read += inc;
}
long getBytesWritten() {
return written;
}
synchronized void incBytesWritten(int inc) {
written += inc;
}
}