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()
ScheduledTaskStatistics
getTotalRuns
in interface ScheduledTaskStatistics
public long getLastRunDuration(TimeUnit unit)
ScheduledTaskStatistics
getLastRunDuration
in interface ScheduledTaskStatistics
unit
- The time unit to return the duration in.public long getLastIdleTime(TimeUnit unit)
ScheduledTaskStatistics
getLastIdleTime
in interface ScheduledTaskStatistics
unit
- The time unit to return the duration in.public long getTotalIdleTime(TimeUnit unit)
ScheduledTaskStatistics
getTotalIdleTime
in interface ScheduledTaskStatistics
unit
- The time unit to return the duration in.public long getTotalRunTime(TimeUnit unit)
ScheduledTaskStatistics
getTotalRunTime
in interface ScheduledTaskStatistics
unit
- The time unit to return the duration in.public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- 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
DataSerializable
readData
in interface DataSerializable
in
- 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 TaskLifecycleListener
public void onBeforeRun()
onBeforeRun
in interface TaskLifecycleListener
public void onAfterRun()
onAfterRun
in interface TaskLifecycleListener
public ScheduledTaskStatisticsImpl snapshot()
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.