public enum WindowsArray extends Enum<WindowsArray>
| Enum Constant and Description |
|---|
INSTANCE
singleton
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRt(long startTime,
long responseTime)
increase response time
|
void |
addSuccess(long startTime)
increase success count
|
void |
addThreadNum(long startTime)
increase thread count
|
int |
calculateCurrentWindowsIndex()
Computes the window index for the current point in time
|
int |
calculateNextWindowsIndex()
Calculates the index of the next window at the current point in time
|
int |
calculatePreviousWindowsIndex()
Calculates the index of the previous window at the current time
|
int |
calculateWindowsIndex(long startTime)
compute window index
|
void |
decreaseThreadNum(long startTime)
reduce thread count
|
io.sermant.flowcontrol.res4j.windows.WindowsBucket |
getCurrentWindow()
gets the current point in time window
|
io.sermant.flowcontrol.res4j.windows.WindowsBucket |
getPreviousWindow()
gets a window before the current point in time
|
long |
getThreadNum()
gets the current number of threads
|
io.sermant.flowcontrol.res4j.windows.WindowsBucket |
getWindow(int index)
gets the window for the specified index
|
AtomicReferenceArray<io.sermant.flowcontrol.res4j.windows.WindowsBucket> |
getWindowsArray()
gets the sliding window array
|
void |
initWindowsArray()
initialize
|
void |
resetNextWindows()
reset the next window data
|
static WindowsArray |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static WindowsArray[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final WindowsArray INSTANCE
public static WindowsArray[] values()
for (WindowsArray c : WindowsArray.values()) System.out.println(c);
public static WindowsArray valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic void initWindowsArray()
public io.sermant.flowcontrol.res4j.windows.WindowsBucket getCurrentWindow()
public io.sermant.flowcontrol.res4j.windows.WindowsBucket getPreviousWindow()
public io.sermant.flowcontrol.res4j.windows.WindowsBucket getWindow(int index)
index - indexpublic long getThreadNum()
public void addSuccess(long startTime)
startTime - requestTimepublic void addRt(long startTime,
long responseTime)
startTime - requestTimeresponseTime - responseTimepublic void addThreadNum(long startTime)
startTime - requestTimepublic void decreaseThreadNum(long startTime)
startTime - requestTimepublic int calculateCurrentWindowsIndex()
public void resetNextWindows()
public int calculateNextWindowsIndex()
public int calculateWindowsIndex(long startTime)
startTime - request timepublic int calculatePreviousWindowsIndex()
public AtomicReferenceArray<io.sermant.flowcontrol.res4j.windows.WindowsBucket> getWindowsArray()
Copyright © 2025. All rights reserved.