public class ClusterMetric extends Object
| Constructor and Description |
|---|
ClusterMetric(int sampleCount,
int intervalInMs) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(ClusterFlowEvent event,
long count) |
double |
getAvg(ClusterFlowEvent event)
Get average count for provided event per second.
|
long |
getCurrentCount(ClusterFlowEvent event) |
long |
getSum(ClusterFlowEvent event)
Get total sum for provided event in
intervalInSec. |
int |
tryOccupyNext(ClusterFlowEvent event,
int acquireCount,
double threshold)
Try to pre-occupy upcoming buckets.
|
public void add(ClusterFlowEvent event, long count)
public long getCurrentCount(ClusterFlowEvent event)
public long getSum(ClusterFlowEvent event)
intervalInSec.event - event to calculatepublic double getAvg(ClusterFlowEvent event)
event - event to calculatepublic int tryOccupyNext(ClusterFlowEvent event, int acquireCount, double threshold)
Copyright © 2020 Alibaba Group. All rights reserved.