Check before init agg metrics (#12989)

This commit is contained in:
Albumen Kevin 2023-08-31 19:30:27 +08:00 committed by GitHub
parent c12a57eb3c
commit 025c078948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -267,10 +267,16 @@ public class AggregateMetricsCollector implements MetricsCollector<RequestEvent>
@Override
public void initMetrics(MetricsEvent event) {
MethodMetric metric = new MethodMetric(applicationModel, event.getAttachmentValue(MetricsConstants.INVOCATION));
initMethodMetric(event);
initQpsMetric(metric);
initRtMetric(metric);
initRtAgrMetric(metric);
if (enableQps) {
initMethodMetric(event);
initQpsMetric(metric);
}
if (enableRt) {
initRtMetric(metric);
}
if (enableRtPxx) {
initRtAgrMetric(metric);
}
}
public void initMethodMetric(MetricsEvent event){