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
[JAV-539] & [SCB-9] Implement CallCount and TPS Metrics #451
Conversation
@@ -19,7 +19,8 @@ | |||
|
|||
public class InstanceMetric extends ModelMetric { | |||
public InstanceMetric(long waitInQueue, TimerMetric lifeTimeInQueue, | |||
TimerMetric executionTime, TimerMetric consumerLatency, TimerMetric producerLatency) { |
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.
We should know if the invocation is consumer or producer to avoid storing other two metrics here.
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.
Done,Separate into tow metric named "ConsumerInvocationMetric" and "ProducerInvocationMetric"
@@ -31,5 +32,5 @@ servicecomb: | |||
metrics: | |||
#polling setting | |||
polling: | |||
#Time Unit is MILLISECONDS | |||
#Support Muti Polling Time (MILLISECONDS) like 10000,60000 (10s and 60s) |
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.
Which polling time does metric use?
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.
Both , support muti polling time ,use pollerIndex make a selection
RegistryMetric getRegistryMetric(int pollerIndex)
private final TimerMonitor consumerLatency; | ||
|
||
private final TimerMonitor producerLatency; | ||
private final CallMonitor producerCall; |
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.
We still have the prducerXXX and consumerXXX here!
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.
Because can't known invocation type before starting process ,all monitor temp keep in this class; when it convert to metric while polling ,will be separate into ConsumerMetric and ProducerMetric.
After Java Chassis improved invocation generation logic, will be refactor this code immediately
Changes Unknown when pulling f6332fa on zhengyangyong:JAV-539&SCB-9 into ** on apache:master**. |
Changes Unknown when pulling 7511c98 on zhengyangyong:JAV-539&SCB-9 into ** on apache:master**. |
Changes Unknown when pulling 5e76ae1 on zhengyangyong:JAV-539&SCB-9 into ** on apache:master**. |
5e76ae1
to
7722848
Compare
consumerLatency = consumerLatency.merge(metric.getConsumerLatency()); | ||
producerLatency = producerLatency.merge(metric.getProducerLatency()); | ||
if (metric != null) { | ||
if (metric instanceof ConsumerInvocationMetric) { |
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.
think of open closed principle
|
||
//Counting use System.nano get more precise time | ||
//so we need change unit to millisecond when ouput | ||
public double convertNanosecondToMillisecond(long nanoValue){ |
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.
why double for milliseconds?
Rebase onto master and resolve conflicts |
@@ -41,9 +41,14 @@ public InvocationStartProcessingEventListener(RegistryMonitor registryMonitor) { | |||
public void process(Event data) { | |||
InvocationStartProcessingEvent event = (InvocationStartProcessingEvent) data; | |||
InvocationMonitor monitor = registryMonitor.getInvocationMonitor(event.getOperationName()); | |||
//TODO:current java chassis unable know invocation type before starting process,so all type WaitInQueue increment(-1) (decrement) |
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.
why?
event.getInvocationType is not you want?
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.
and in fact, we only trigger InvocationStartProcessingEvent in producer invocation
missed it in consumer invocation.
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.
Great,it's a important info for me ,thank a lot
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.
Done,Consumer Side Event will be trigger in VertxHttpClient and HighwayClient,https://issues.apache.org/jira/browse/SCB-126
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
…ion metric SCB-91 All Monitor can convert to Map with plain-key when polling data Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
…nymore) Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
…cond Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
…temMonitor" Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
2269965
to
2a0f1b8
Compare
resolve conflict |
Follow this checklist to help us incorporate your contribution quickly and easily:
[JAV-XXX] Fixes bug in ApproximateQuantiles
, where you replaceJAV-XXX
with the appropriate JIRA issue.mvn clean install
to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.JAV-539 & SC-9 Implement CallCount and TPS Metrics
In core module we need add more build-in Metrics,include:
1.consumer total call count
2.provider total call count
3.consumer call tps
4.provider call tps