-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
support for observing metrics collected on seata client side #4878
Conversation
fix snapshot
This pull request introduces 7 alerts when merging 77ad527 into 06c2a50 - view on LGTM.com new alerts:
|
metrics/seata-metrics-service/src/main/java/io/seata/metrics/TMMeterIdConstants.java
Show resolved
Hide resolved
@@ -0,0 +1,30 @@ | |||
package io.seata.metrics.service; |
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.
Copyright加一下
|
||
import io.seata.common.ConfigurationKeys; | ||
import io.seata.config.ConfigurationFactory; | ||
import io.seata.core.context.RootContext; |
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.
无用包不要导入
import java.util.concurrent.TimeUnit; | ||
import java.util.function.Consumer; | ||
|
||
import static io.seata.metrics.IdConstants.*; |
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.
不要*号导入
import io.seata.core.event.BranchEvent; | ||
import io.seata.core.event.GlobalTransactionEvent; | ||
import io.seata.core.model.GlobalStatus; | ||
import io.seata.metrics.IdConstants; |
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.
无用包不要导入
|
||
consumers.put(STATUS_VALUE_AFTER_COMMITTED_KEY, this::processAfterGlobalCommitted); | ||
consumers.put(STATUS_VALUE_AFTER_ROLLBACKED_KEY, this::processAfterGlobalRollbacked); | ||
}else if (MetricsManager.get().getRole().equals(MetricsManager.get().ROLE_VALUE_CLIENT)) { |
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.
p3c格式化下代码
@Subscribe | ||
public void recordGlobalTransactionEventForMetrics(GlobalTransactionEvent event) { | ||
if (registry != null) { | ||
if (consumers.containsKey(event.getMetricEvent())){ |
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.
格式化下代码 少空格
metrics/seata-metrics-service/src/main/java/io/seata/metrics/RMMeterIdConstants.java
Show resolved
Hide resolved
import io.seata.metrics.Id; | ||
import io.seata.metrics.IdConstants; |
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.
导包改一下
@@ -28,6 +28,7 @@ | |||
import io.seata.core.model.BranchType; | |||
import io.seata.core.model.Resource; | |||
import io.seata.core.model.ResourceManager; | |||
import io.seata.metrics.service.MetricsPublisher; |
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.
去掉无用导包
@@ -112,6 +113,7 @@ public boolean lockQuery(BranchType branchType, String resourceId, | |||
@Override | |||
public void registerResource(Resource resource) { | |||
getResourceManager(resource.getBranchType()).registerResource(resource); | |||
|
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.
去掉空行
Codecov Report
@@ Coverage Diff @@
## develop #4878 +/- ##
=============================================
- Coverage 49.23% 48.50% -0.73%
+ Complexity 4117 4084 -33
=============================================
Files 737 740 +3
Lines 25827 26757 +930
Branches 3193 3191 -2
=============================================
+ Hits 12715 12979 +264
- Misses 11764 12433 +669
+ Partials 1348 1345 -3
|
Due to code conflicts and age, if you are still interested in participating in the community, please resubmit this pr to the 2.x branch after resolving the conflict. |
好的,我后面基于2.x分支重新弄一下 |
Ⅰ. Describe what this PR did
Improved the monitoring of various data on the Seata Client side. Help users effectively monitor the execution process and identify possible problems.
Ⅱ. Does this pull request fix one issue?
fixes #4637
Ⅲ. Why don't you add test cases (unit test/integration test)?
I'll add later.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews