Class AllocationStatistic
java.lang.Object
eu.cloudnetservice.driver.network.rpc.defaults.object.data.AllocationStatistic
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
STATISTIC_HOLDER_UPDATER
-
statisticHolder
private long[] statisticHolder
-
-
Constructor Details
-
AllocationStatistic
AllocationStatistic()
-
-
Method Details
-
add
public void add(int allocatedBytes) Adds the given amount of bytes from an allocation run into the statistic. If the given allocated bytes are negative or a long overflow would occur adding it, the call is silently ignored.- Parameters:
allocatedBytes- the bytes that were allocated during a serialization.
-
average
public int average()Get the average amount of bytes being allocated in the past allocation runs.- Returns:
- the average amount of bytes being allocated in the past allocation runs.
- Throws:
ArithmeticException- if the allocation byte average overflows an int.
-