-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature buckets #37
Feature buckets #37
Conversation
client/lookout-core/src/main/java/com/alipay/lookout/core/DefaultRegistry.java
Show resolved
Hide resolved
} else { | ||
iterator = priorityMetricsCache.getMetricByPriority(priority).iterator(); | ||
} | ||
return new MetricIterator(iterator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SchedulerPoller是主动push模式的一个遍历模式。 新的master代码有了pull 模式,也有个定时遍历逻辑。 稳妥, MetricInterator的封装,尽量提前封装(比如regsitry 的 interator 对象)。 这样无论外部几个遍历主体也没关系。
...nt/lookout-reg-server/src/main/java/com/alipay/lookout/remote/step/LookoutBucketCounter.java
Show resolved
Hide resolved
|
||
@Override | ||
public Indicator measure() { | ||
long now = Clock.SYSTEM.wallTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上报的时间要对齐下:lastInitPos.get() * step
Motivation:
add buckets support to DistributionSummay and Timer
Modification:
add two methods:
DistributionSummay.buckets(long[] buckets)
Timer.buckets(long[] buckets)
add a base class BucketCounter to implement buckets
bucketed metrics will create new metrics with name original_metric_name.buckets and a new tag _bucket and tag values like 0-10,10-100 ... 10000-