public class ScheduledTaskStatisticsImpl extends Object implements ScheduledTaskStatistics, TaskLifecycleListener, Versioned
| Constructor and Description |
|---|
ScheduledTaskStatisticsImpl() |
ScheduledTaskStatisticsImpl(long runs,
long lastIdleTimeNanos,
long totalRunTimeNanos,
long totalIdleTimeNanos,
long lastRunDuration) |
ScheduledTaskStatisticsImpl(ScheduledTaskStatisticsImpl copy) |
| Modifier and Type | Method and Description |
|---|---|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
long |
getLastIdleTime(TimeUnit unit)
Returns the last period of time the task was idle, waiting to get scheduled
|
long |
getLastRunDuration(TimeUnit unit)
Returns the duration of the task's last execution.
|
long |
getTotalIdleTime(TimeUnit unit)
Returns the total amount of time the task was idle, waiting to get scheduled in.
|
long |
getTotalRuns()
Returns how many times the task was ran/called.
|
long |
getTotalRunTime(TimeUnit unit)
Returns the total amount of time the task spent while scheduled in.
|
void |
onAfterRun() |
void |
onBeforeRun() |
void |
onInit() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
ScheduledTaskStatisticsImpl |
snapshot() |
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public ScheduledTaskStatisticsImpl()
public ScheduledTaskStatisticsImpl(ScheduledTaskStatisticsImpl copy)
public ScheduledTaskStatisticsImpl(long runs,
long lastIdleTimeNanos,
long totalRunTimeNanos,
long totalIdleTimeNanos,
long lastRunDuration)
public long getTotalRuns()
ScheduledTaskStatisticsgetTotalRuns in interface ScheduledTaskStatisticspublic long getLastRunDuration(TimeUnit unit)
ScheduledTaskStatisticsgetLastRunDuration in interface ScheduledTaskStatisticsunit - The time unit to return the duration in.public long getLastIdleTime(TimeUnit unit)
ScheduledTaskStatisticsgetLastIdleTime in interface ScheduledTaskStatisticsunit - The time unit to return the duration in.public long getTotalIdleTime(TimeUnit unit)
ScheduledTaskStatisticsgetTotalIdleTime in interface ScheduledTaskStatisticsunit - The time unit to return the duration in.public long getTotalRunTime(TimeUnit unit)
ScheduledTaskStatisticsgetTotalRunTime in interface ScheduledTaskStatisticsunit - The time unit to return the duration in.public int getFactoryId()
IdentifiedDataSerializablegetFactoryId in interface IdentifiedDataSerializablepublic int getId()
IdentifiedDataSerializablegetId in interface IdentifiedDataSerializablepublic void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - outputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializablereadData in interface DataSerializablein - inputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
input stream has been closed.public void onInit()
onInit in interface TaskLifecycleListenerpublic void onBeforeRun()
onBeforeRun in interface TaskLifecycleListenerpublic void onAfterRun()
onAfterRun in interface TaskLifecycleListenerpublic ScheduledTaskStatisticsImpl snapshot()
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.