Class ProcessSnapshot
- java.lang.Object
-
- de.dytanic.cloudnet.driver.service.ProcessSnapshot
-
- All Implemented Interfaces:
SerializableObject
public class ProcessSnapshot extends java.lang.Object implements SerializableObject
A snapshot of a process in the Cloud which provides information about the cpu and memory usage, the running threads and the pid.
-
-
Constructor Summary
Constructors Constructor Description ProcessSnapshot()ProcessSnapshot(long heapUsageMemory, long noHeapUsageMemory, long maxHeapMemory, int currentLoadedClassCount, long totalLoadedClassCount, long unloadedClassCount, java.util.Collection<ThreadSnapshot> threads, double cpuUsage, int pid)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProcessSnapshotempty()Gets an empty snapshot without any information about the process.doublegetCpuUsage()intgetCurrentLoadedClassCount()longgetHeapUsageMemory()longgetMaxHeapMemory()longgetNoHeapUsageMemory()static intgetOwnPID()Gets the PID of the current process or -1 if it couldn't be fetched.intgetPid()java.util.Collection<ThreadSnapshot>getThreads()longgetTotalLoadedClassCount()longgetUnloadedClassCount()voidread(@NotNull ProtocolBuffer buffer)static ProcessSnapshotself()Creates a new snapshot with information about the current process.voidwrite(@NotNull ProtocolBuffer buffer)
-
-
-
Constructor Detail
-
ProcessSnapshot
public ProcessSnapshot(long heapUsageMemory, long noHeapUsageMemory, long maxHeapMemory, int currentLoadedClassCount, long totalLoadedClassCount, long unloadedClassCount, java.util.Collection<ThreadSnapshot> threads, double cpuUsage, int pid)
-
ProcessSnapshot
public ProcessSnapshot()
-
-
Method Detail
-
empty
public static ProcessSnapshot empty()
Gets an empty snapshot without any information about the process.- Returns:
- an empty constant
ProcessSnapshot
-
self
public static ProcessSnapshot self()
Creates a new snapshot with information about the current process.- Returns:
- a new
ProcessSnapshot
-
getOwnPID
public static int getOwnPID()
Gets the PID of the current process or -1 if it couldn't be fetched.
-
getHeapUsageMemory
public long getHeapUsageMemory()
-
getNoHeapUsageMemory
public long getNoHeapUsageMemory()
-
getMaxHeapMemory
public long getMaxHeapMemory()
-
getCurrentLoadedClassCount
public int getCurrentLoadedClassCount()
-
getTotalLoadedClassCount
public long getTotalLoadedClassCount()
-
getUnloadedClassCount
public long getUnloadedClassCount()
-
getThreads
public java.util.Collection<ThreadSnapshot> getThreads()
-
getCpuUsage
public double getCpuUsage()
-
getPid
public int getPid()
-
write
public void write(@NotNull @NotNull ProtocolBuffer buffer)- Specified by:
writein interfaceSerializableObject
-
read
public void read(@NotNull @NotNull ProtocolBuffer buffer)- Specified by:
readin interfaceSerializableObject
-
-