Modifier and Type | Field and Description |
---|---|
private int |
average |
(package private) long[] |
cpuTime |
private long |
id
the thread ID of the monitored thread
|
(package private) int |
idx |
private Logger |
logger
logger
|
private String |
name
the thread name of the monitored thread
|
(package private) int |
nb |
Constructor and Description |
---|
AverageCPUTask(long id,
int nb)
Creates a task that periodically computes the thread load.
|
Modifier and Type | Method and Description |
---|---|
int |
getAverage() |
void |
run() |
void |
start(Timer timer)
Starts the resulting task.
|
cancel, scheduledExecutionTime
private Logger logger
long[] cpuTime
int idx
int nb
private long id
private String name
private int average
public AverageCPUTask(long id, int nb)
id
- thread ID of the monitored threadnb
- number of refresh per minutepublic int getAverage()
public void run()
run
in interface Runnable
run
in class TimerTask
TimerTask.run()
public void start(Timer timer)
timer
- Timer to use to schedule the resulting task.Copyright © 2023 ScalAgent D.T.. All rights reserved.