fix: code format (#11258)
* fix: code format * fix: code format * fix: code format
This commit is contained in:
parent
84b152f40c
commit
d8e6dfa42a
|
|
@ -140,9 +140,7 @@ public class DefaultMetricsCollector implements MetricsCollector {
|
|||
.ifPresent(map-> map.forEach((k, v) -> list.add(new GaugeMetricSample(MetricsKey.METRIC_REQUESTS_SUCCEED, k.getTags(), REQUESTS, v::get))));
|
||||
|
||||
doExecute(RequestEvent.Type.FAILED, MetricsStatHandler::get).filter(e->!e.isEmpty())
|
||||
.ifPresent(map->{
|
||||
map.forEach((k, v) -> list.add(new GaugeMetricSample(MetricsKey.METRIC_REQUESTS_FAILED, k.getTags(), REQUESTS, v::get)));
|
||||
});
|
||||
.ifPresent(map-> map.forEach((k, v) -> list.add(new GaugeMetricSample(MetricsKey.METRIC_REQUESTS_FAILED, k.getTags(), REQUESTS, v::get))));
|
||||
|
||||
doExecute(RequestEvent.Type.PROCESSING, MetricsStatHandler::get).filter(e->!e.isEmpty())
|
||||
.ifPresent(map-> map.forEach((k, v) -> list.add(new GaugeMetricSample(MetricsKey.METRIC_REQUESTS_PROCESSING, k.getTags(), REQUESTS, v::get))));
|
||||
|
|
@ -150,13 +148,11 @@ public class DefaultMetricsCollector implements MetricsCollector {
|
|||
doExecute(RequestEvent.Type.BUSINESS_FAILED, MetricsStatHandler::get).filter(e->!e.isEmpty())
|
||||
.ifPresent(map-> map.forEach((k, v) -> list.add(new GaugeMetricSample(MetricsKey.METRIC_REQUEST_BUSINESS_FAILED, k.getTags(), REQUESTS, v::get))));
|
||||
|
||||
|
||||
doExecute(RequestEvent.Type.REQUEST_TIMEOUT, MetricsStatHandler::get).filter(e->!e.isEmpty())
|
||||
.ifPresent(map-> map.forEach((k, v) -> list.add(new GaugeMetricSample(MetricsKey.METRIC_REQUESTS_TIMEOUT_AGG, k.getTags(), REQUESTS, v::get))));
|
||||
|
||||
doExecute(RequestEvent.Type.REQUEST_LIMIT, MetricsStatHandler::get).filter(e->!e.isEmpty())
|
||||
.ifPresent(map-> map.forEach((k, v) -> list.add(new GaugeMetricSample(MetricsKey.METRIC_REQUESTS_LIMIT_AGG, k.getTags(), REQUESTS, v::get))));
|
||||
|
||||
}
|
||||
|
||||
private void collectRT(List<MetricSample> list) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ public class DefaultMetricsStatHandler implements MetricsStatHandler {
|
|||
this.doExecute(interfaceName,methodName,group,version,(metric,counts)->{
|
||||
AtomicLong count = counts.computeIfAbsent(metric, k -> new AtomicLong(0L));
|
||||
count.incrementAndGet();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -69,6 +68,5 @@ public class DefaultMetricsStatHandler implements MetricsStatHandler {
|
|||
return counts;
|
||||
}
|
||||
|
||||
public void doNotify(MethodMetric metric){}
|
||||
|
||||
public void doNotify(MethodMetric metric){}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@ import org.apache.dubbo.rpc.RpcInvocation;
|
|||
public class MetricsCollectExecutor {
|
||||
|
||||
private final DefaultMetricsCollector collector;
|
||||
private final Invocation invocation;
|
||||
private String interfaceName;
|
||||
private String methodName;
|
||||
private String group;
|
||||
private String version;
|
||||
private final Invocation invocation;
|
||||
private String interfaceName;
|
||||
private String methodName;
|
||||
private String group;
|
||||
private String version;
|
||||
|
||||
|
||||
public MetricsCollectExecutor(DefaultMetricsCollector collector, Invocation invocation) {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class MetricsFilter implements Filter, BaseFilter.Listener, ScopeModelAwa
|
|||
|
||||
@Override
|
||||
public void onError(Throwable t, Invoker<?> invoker, Invocation invocation) {
|
||||
collect(invocation,collector-> collector.throwExecute(t));
|
||||
collect(invocation, collector-> collector.throwExecute(t));
|
||||
}
|
||||
|
||||
private void collect(Invocation invocation, Consumer<MetricsCollectExecutor> execute) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue