public class ResourceUtilizationWindow extends Object
ResourceUtilizationDetector
Constructor and Description |
---|
ResourceUtilizationWindow() |
Modifier and Type | Method and Description |
---|---|
void |
addValue(long timestamp,
double value)
Append a new value to window
|
double |
avg() |
void |
clear() |
void |
deleteExpiredValues(long now,
int durationMs)
Delete values that are older than durationMs
|
boolean |
isEmpty() |
long |
length(long now)
Returns length of the window in milliseconds given current timestamp
|
double |
sum()
For tests
|
public void addValue(long timestamp, double value)
timestamp
- Timestamp of the valuevalue
- Valuepublic void deleteExpiredValues(long now, int durationMs)
now
- Current timestampdurationMs
- Delete values in the window that are older than durationMspublic void clear()
public double avg()
public long length(long now)
now
- Current timestamppublic double sum()
public boolean isEmpty()