Package io.perl.api.impl
Class ElasticWait
java.lang.Object
io.perl.api.impl.ElasticWait
Class ElasticWait.
-
Constructor Summary
ConstructorDescriptionElasticWait
(int idleNS, int windowIntervalMS, int minIntervalMS) Constructor ElasticWait initialize all values. -
Method Summary
Modifier and TypeMethodDescriptionvoid
reset()
This method initializeidleCount
to zero.void
setElastic
(long currentIntervalMS) This method sets theelasticCount
and initializetotalCount
to zero.void
updateElastic
(long elapsedIntervalMS) This method update theelasticCount
.boolean
Checks ifidleCount
is greater thanelasticCount
.
-
Constructor Details
-
ElasticWait
public ElasticWait(int idleNS, int windowIntervalMS, int minIntervalMS) Constructor ElasticWait initialize all values.- Parameters:
idleNS
- intwindowIntervalMS
- intminIntervalMS
- int
-
-
Method Details
-
reset
public void reset()This method initializeidleCount
to zero. -
waitAndCheck
public boolean waitAndCheck()Checks ifidleCount
is greater thanelasticCount
.- Returns:
- true if
idleCount
>elasticCount
.
-
updateElastic
public void updateElastic(long elapsedIntervalMS) This method update theelasticCount
.- Parameters:
elapsedIntervalMS
- long
-
setElastic
public void setElastic(long currentIntervalMS) This method sets theelasticCount
and initializetotalCount
to zero.- Parameters:
currentIntervalMS
- long
-