-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
Adds metrics initialization metrics for the service interface(#12850) #12892
Conversation
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.
@songxiaosheng @wxbty PTAL
Codecov Report
@@ Coverage Diff @@
## 3.2 #12892 +/- ##
=============================================
+ Coverage 68.76% 69.50% +0.73%
+ Complexity 318 2 -316
=============================================
Files 3657 1649 -2008
Lines 171093 68486 -102607
Branches 28245 9996 -18249
=============================================
- Hits 117660 47599 -70061
+ Misses 43258 16294 -26964
+ Partials 10175 4593 -5582 see 2056 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM
initWindowCounter(event,MetricsKey.METRIC_REQUESTS_NETWORK_FAILED_AGG); | ||
initWindowCounter(event,MetricsKey.METRIC_REQUESTS_CODEC_FAILED_AGG); | ||
initWindowCounter(event,MetricsKey.METRIC_REQUESTS_TOTAL_SERVICE_UNAVAILABLE_FAILED_AGG); | ||
} |
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.
These constants can be placed in DefaultConstants in the form of List, and then foreach does init, which can reduce duplication
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.
ok
} | ||
methodNumStats.get(wrapper).computeIfAbsent(new MethodMetric(getApplicationModel(), invocation), k -> new AtomicLong(0L)).set(size); | ||
} | ||
|
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.
The init method can directly set 0, no need to transfer parameters
onInitRtRequest(metric); | ||
onInitRtAgrRequest(metric); | ||
return; | ||
} |
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.
RequestInitEvent and RequestEvent look different, one is triggered by app init, the other is triggered by rpc request, is it better to separate the listener?
public static MetricsInitEvent toMetricsInitEvent(ApplicationModel applicationModel, Invocation invocation) { | ||
MethodMetric methodMetric = new MethodMetric(applicationModel, invocation); | ||
MetricsInitEvent initEvent = new MetricsInitEvent(applicationModel, new TypeWrapper(MetricsLevel.SERVICE, METRIC_REQUESTS)); | ||
initEvent.putAttachment(MetricsConstants.INVOCATION, 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.
Do not create immutable objects every time.
@@ -69,7 +70,7 @@ private CategoryOverall initMethodRequest() { | |||
MetricsSupport.increment(key, dynamicPlaceType, (MethodMetricsCollector) collector, event); | |||
MetricsSupport.increment(MetricsKey.METRIC_REQUESTS_PROCESSING, dynamicPlaceType, (MethodMetricsCollector) collector, event); | |||
})), | |||
new MetricsCat(MetricsKey.METRIC_REQUESTS_SUCCEED, (key, placeType, collector) -> AbstractMetricsKeyListener.onFinish(key, | |||
new MetricsCat(METRIC_REQUESTS_SUCCEED, (key, placeType, collector) -> AbstractMetricsKeyListener.onFinish(key, |
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.
Don't change that. Keep it the same as before
Kudos, SonarCloud Quality Gate passed! |
LGTM |
Adds metrics initialization metrics for the service interface(#12850)