Class Pane<T>
java.lang.Object
org.apache.dubbo.metrics.aggregate.Pane<T>
- Type Parameters:
T- The type of value the pane statistics.
The pane represents a window over a period of time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet end timestamp of the pane in milliseconds.longGet the interval of the pane in milliseconds.longGet start timestamp of the pane in milliseconds.getValue()Get the pane statistics value.booleanisTimeInWindow(long timeMillis) Check whether given timestamp is in current pane.voidsetStartInMs(long newStartInMs) Set the new start timestamp to the pane, for reset the instance.voidSet new value to the pane, for reset the instance.
-
Constructor Details
-
Pane
- Parameters:
intervalInMs- interval of the pane in milliseconds.startInMs- start timestamp of the pane in milliseconds.value- the pane value.
-
-
Method Details
-
getIntervalInMs
public long getIntervalInMs()Get the interval of the pane in milliseconds.- Returns:
- the interval of the pane in milliseconds.
-
getStartInMs
public long getStartInMs()Get start timestamp of the pane in milliseconds.- Returns:
- the start timestamp of the pane in milliseconds.
-
getEndInMs
public long getEndInMs()Get end timestamp of the pane in milliseconds.- Returns:
- the end timestamp of the pane in milliseconds.
-
getValue
Get the pane statistics value.- Returns:
- the pane statistics value.
-
setStartInMs
public void setStartInMs(long newStartInMs) Set the new start timestamp to the pane, for reset the instance.- Parameters:
newStartInMs- the new start timestamp.
-
setValue
Set new value to the pane, for reset the instance.- Parameters:
newData- the new value.
-
isTimeInWindow
public boolean isTimeInWindow(long timeMillis) Check whether given timestamp is in current pane.- Parameters:
timeMillis- timestamp in milliseconds.- Returns:
- true if the given time is in current pane, otherwise false
-