Package oshi.software.os.unix.openbsd
Class OpenBsdOSThread
- java.lang.Object
-
- oshi.software.common.AbstractOSThread
-
- oshi.software.os.unix.openbsd.OpenBsdOSThread
-
- All Implemented Interfaces:
OSThread
@ThreadSafe public class OpenBsdOSThread extends AbstractOSThread
OSThread implementation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface oshi.software.os.OSThread
OSThread.ThreadFiltering
-
-
Field Summary
Fields Modifier and Type Field Description private longcontextSwitchesprivate longkernelTimeprivate longmajorFaultsprivate longminorFaultsprivate java.lang.Stringnameprivate intpriorityprivate longstartMemoryAddressprivate longstartTimeprivate OSProcess.Statestateprivate intthreadIdprivate longupTimeprivate longuserTime
-
Constructor Summary
Constructors Constructor Description OpenBsdOSThread(int processId, int threadId)OpenBsdOSThread(int processId, java.util.Map<OpenBsdOSProcess.PsThreadColumns,java.lang.String> threadMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetContextSwitches()A snapshot of the context switches the thread has done.longgetKernelTime()Kernel (privileged) time used by the thread.longgetMajorFaults()The number of major (hard) faults the thread has made which have required loading a memory page from disk.longgetMinorFaults()The number of minor (soft) faults the thread has made which have not required loading a memory page from disk.java.lang.StringgetName()The name of the thread.intgetPriority()Priority of the thread, the meaning of which is dependent on the OS.longgetStartMemoryAddress()The memory address above which this thread can run.longgetStartTime()The start time of the thread.OSProcess.StategetState()Gets the execution state of the task/thread.intgetThreadId()The thread id.longgetUpTime()Elapsed/up-time of the thread.longgetUserTime()User time used by the thread.booleanupdateAttributes()Attempts to updates process attributes.private booleanupdateAttributes(java.util.Map<OpenBsdOSProcess.PsThreadColumns,java.lang.String> threadMap)-
Methods inherited from class oshi.software.common.AbstractOSThread
getOwningProcessId, getThreadCpuLoadBetweenTicks, getThreadCpuLoadCumulative, toString
-
-
-
-
Field Detail
-
threadId
private int threadId
-
name
private java.lang.String name
-
state
private OSProcess.State state
-
minorFaults
private long minorFaults
-
majorFaults
private long majorFaults
-
startMemoryAddress
private long startMemoryAddress
-
contextSwitches
private long contextSwitches
-
kernelTime
private long kernelTime
-
userTime
private long userTime
-
startTime
private long startTime
-
upTime
private long upTime
-
priority
private int priority
-
-
Constructor Detail
-
OpenBsdOSThread
public OpenBsdOSThread(int processId, java.util.Map<OpenBsdOSProcess.PsThreadColumns,java.lang.String> threadMap)
-
OpenBsdOSThread
public OpenBsdOSThread(int processId, int threadId)
-
-
Method Detail
-
getThreadId
public int getThreadId()
Description copied from interface:OSThreadThe thread id. The meaning of this value is OS-dependent.- Returns:
- Returns the id of the thread.
-
getName
public java.lang.String getName()
Description copied from interface:OSThreadThe name of the thread. Presence of a name is operating-system dependent and may include information (such as an index of running threads) that changes during execution.- Returns:
- Returns the name of the task/thread.
-
getState
public OSProcess.State getState()
Description copied from interface:OSThreadGets the execution state of the task/thread.- Returns:
- Returns the execution state of the task/thread.
-
getStartMemoryAddress
public long getStartMemoryAddress()
Description copied from interface:OSThreadThe memory address above which this thread can run.- Returns:
- The start address.
-
getContextSwitches
public long getContextSwitches()
Description copied from interface:OSThreadA snapshot of the context switches the thread has done. Since the context switches could be voluntary and non-voluntary, this gives the sum of both.Not available on AIX.
- Returns:
- sum of both voluntary and involuntary context switches.
-
getMinorFaults
public long getMinorFaults()
Description copied from interface:OSThreadThe number of minor (soft) faults the thread has made which have not required loading a memory page from disk. Sometimes called reclaims. Linux only.- Returns:
- minor faults.
-
getMajorFaults
public long getMajorFaults()
Description copied from interface:OSThreadThe number of major (hard) faults the thread has made which have required loading a memory page from disk. Linux only.- Returns:
- major faults.
-
getKernelTime
public long getKernelTime()
Description copied from interface:OSThreadKernel (privileged) time used by the thread.- Returns:
- Returns the number of milliseconds the task/thread has executed in kernel/system mode.
-
getUserTime
public long getUserTime()
Description copied from interface:OSThreadUser time used by the thread.- Returns:
- Returns the number of milliseconds the task/thread has executed in user mode.
-
getUpTime
public long getUpTime()
Description copied from interface:OSThreadElapsed/up-time of the thread.- Returns:
- Returns the number of milliseconds since the task/thread started.
-
getStartTime
public long getStartTime()
Description copied from interface:OSThreadThe start time of the thread.- Returns:
- Returns the start time of the task/thread in number of milliseconds since January 1, 1970.
-
getPriority
public int getPriority()
Description copied from interface:OSThreadPriority of the thread, the meaning of which is dependent on the OS.- Returns:
- priority.
-
updateAttributes
public boolean updateAttributes()
Description copied from interface:OSThreadAttempts to updates process attributes. Returns false if the update fails, which will occur if the process no longer exists. Not implemented for macOS, as thread ID is simply an index and not unique.- Returns:
trueif the update was successful, false if the update failed. In addition, on a failed update the thread state will be changed toOSProcess.State.INVALID.
-
updateAttributes
private boolean updateAttributes(java.util.Map<OpenBsdOSProcess.PsThreadColumns,java.lang.String> threadMap)
-
-