public class ArrayMetric extends Object implements Metric
BucketLeapArray internal.| Constructor and Description |
|---|
ArrayMetric(int sampleCount,
int intervalInMs) |
ArrayMetric(int sampleCount,
int intervalInMs,
boolean enableOccupy) |
ArrayMetric(LeapArray<MetricBucket> array)
For unit test.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(MetricEvent event,
long count) |
void |
addBlock(int count)
Add current block count.
|
void |
addException(int count)
Add current exception count.
|
void |
addOccupiedPass(int acquireCount)
Add occupied pass, which represents pass requests that borrow the latter windows' token.
|
void |
addPass(int count)
Add current pass count.
|
void |
addRT(long rt)
Add given RT to current total RT.
|
void |
addSuccess(int count)
Add current completed count.
|
void |
addWaiting(long time,
int acquireCount)
Add request that occupied.
|
long |
block()
Get total block count.
|
void |
debug()
For debug;
|
List<MetricNode> |
details()
Get aggregated metric nodes of all resources.
|
List<MetricNode> |
detailsOnCondition(Predicate<Long> timePredicate)
Generate aggregated metric items that satisfies the time predicate.
|
long |
exception()
Get total exception count.
|
double |
getAvg(MetricEvent event)
Get average count for provided event per second.
|
long |
getCurrentCount(MetricEvent event) |
int |
getSampleCount()
Get sample count of the sliding window.
|
long |
getSum(MetricEvent event)
Get total sum for provided event in
intervalInSec. |
double |
getWindowIntervalInSec()
Get the sliding window length in seconds.
|
long |
getWindowPass(long timeMillis)
Note: this operation will not perform refreshing, so will not generate new buckets.
|
long |
maxSuccess()
Get max success count.
|
long |
minRt()
Get the minimal RT.
|
long |
occupiedPass()
Get occupied pass count.
|
long |
pass()
Get total pass count.
|
long |
previousWindowBlock() |
long |
previousWindowPass() |
long |
rt()
Get total response time.
|
long |
success()
Get total success count.
|
long |
waiting()
Get waiting pass account
|
MetricBucket[] |
windows()
Get the raw window array.
|
public ArrayMetric(int sampleCount,
int intervalInMs)
public ArrayMetric(int sampleCount,
int intervalInMs,
boolean enableOccupy)
public ArrayMetric(LeapArray<MetricBucket> array)
public long success()
Metricpublic long maxSuccess()
MetricmaxSuccess in interface Metricpublic long exception()
Metricpublic long block()
Metricpublic long pass()
MetricMetric.occupiedPass()public long occupiedPass()
MetricoccupiedPass in interface Metricpublic long rt()
Metricpublic long minRt()
Metricpublic List<MetricNode> details()
Metricpublic List<MetricNode> detailsOnCondition(Predicate<Long> timePredicate)
MetricdetailsOnCondition in interface MetrictimePredicate - time predicatepublic MetricBucket[] windows()
Metricpublic void addException(int count)
MetricaddException in interface Metriccount - count to addpublic void addBlock(int count)
Metricpublic void addWaiting(long time,
int acquireCount)
MetricaddWaiting in interface Metrictime - future timestamp that the acquireCount should be added on.acquireCount - tokens count.public void addOccupiedPass(int acquireCount)
MetricaddOccupiedPass in interface MetricacquireCount - tokens count.public void addSuccess(int count)
MetricaddSuccess in interface Metriccount - count to addpublic void addPass(int count)
Metricpublic void addRT(long rt)
Metricpublic void debug()
DebugSupportdebug in interface DebugSupportpublic long previousWindowBlock()
previousWindowBlock in interface Metricpublic long previousWindowPass()
previousWindowPass in interface Metricpublic void add(MetricEvent event, long count)
public long getCurrentCount(MetricEvent event)
public long getSum(MetricEvent event)
intervalInSec.event - event to calculatepublic double getAvg(MetricEvent event)
event - event to calculatepublic long getWindowPass(long timeMillis)
MetricgetWindowPass in interface MetrictimeMillis - valid time in mspublic long waiting()
Metricpublic double getWindowIntervalInSec()
MetricgetWindowIntervalInSec in interface Metricpublic int getSampleCount()
MetricgetSampleCount in interface MetricCopyright © 2021 Alibaba Group. All rights reserved.