Package one.nio.os.perf
Class PerfCounter
- java.lang.Object
-
- one.nio.os.perf.PerfCounter
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
PerfCounterGlobal
public class PerfCounter extends Object implements Closeable
-
-
Field Summary
Fields Modifier and Type Field Description protected longreadFormat
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattachBpf(int fd)voidclose()voiddisable()voidenable()PerfEventevent()longget()protected long[]getRawValue()CounterValuegetValue()booleanhasReadFormat(int readFormat)protected long[]newBuffer()PerfSamplenextSample()voidrefresh(int count)voidreset()protected LocalValuetoValue(long[] raw)
-
-
-
Method Detail
-
event
public final PerfEvent event()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
get
public long get() throws IOException- Throws:
IOException
-
getValue
public CounterValue getValue() throws IOException
- Throws:
IOException
-
getRawValue
protected long[] getRawValue() throws IOException- Throws:
IOException
-
newBuffer
protected long[] newBuffer()
-
toValue
protected LocalValue toValue(long[] raw)
-
hasReadFormat
public boolean hasReadFormat(int readFormat)
-
nextSample
public PerfSample nextSample()
-
reset
public void reset() throws IOException- Throws:
IOException
-
attachBpf
public void attachBpf(int fd) throws IOException- Throws:
IOException
-
enable
public void enable() throws IOException- Throws:
IOException
-
disable
public void disable() throws IOException- Throws:
IOException
-
refresh
public void refresh(int count) throws IOException- Throws:
IOException
-
-