Skip to content
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

Closed
wants to merge 37 commits into from

Conversation

robynron
Copy link
Contributor

@robynron robynron commented Aug 22, 2022

  • I have registered the PR changes.

Ⅰ. 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

@robynron robynron changed the title on the Seata client 死的 on the Seata client side Aug 22, 2022
@robynron robynron changed the title on the Seata client side Metrics collected on the Seata client side Aug 22, 2022
@robynron robynron changed the title Metrics collected on the Seata client side [WIP] Metrics collected on the Seata client side Aug 22, 2022
@lgtm-com
Copy link

lgtm-com bot commented Aug 23, 2022

This pull request introduces 7 alerts when merging 77ad527 into 06c2a50 - view on LGTM.com

new alerts:

  • 7 for Boxed variable is never null

@@ -0,0 +1,30 @@
package io.seata.metrics.service;
Copy link
Contributor

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;
Copy link
Contributor

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.*;
Copy link
Contributor

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;
Copy link
Contributor

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)) {
Copy link
Contributor

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())){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

格式化下代码 少空格

import io.seata.metrics.Id;
import io.seata.metrics.IdConstants;
Copy link
Contributor

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;
Copy link
Contributor

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);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

去掉空行

@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2022

Codecov Report

Merging #4878 (e44f6fe) into develop (06c2a50) will decrease coverage by 0.72%.
The diff coverage is 43.20%.

❗ Current head e44f6fe differs from pull request most recent head 3511fda. Consider uploading reports for the commit 3511fda to get more accurate results

Impacted file tree graph

@@              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     
Impacted Files Coverage Δ
...c/main/java/io/seata/core/context/RootContext.java 44.61% <0.00%> (-2.16%) ⬇️
...src/main/java/io/seata/core/event/BranchEvent.java 0.00% <0.00%> (ø)
...va/io/seata/core/event/GlobalTransactionEvent.java 0.00% <0.00%> (ø)
.../main/java/io/seata/rm/datasource/AsyncWorker.java 40.62% <0.00%> (-4.21%) ⬇️
...java/io/seata/rm/datasource/DataSourceManager.java 22.22% <0.00%> (-2.17%) ⬇️
...m/datasource/undo/oracle/OracleUndoLogManager.java 10.25% <0.00%> (-1.51%) ⬇️
...urce/undo/postgresql/PostgresqlUndoLogManager.java 7.14% <0.00%> (-0.97%) ⬇️
...configure/SeataServerEnvironmentPostProcessor.java 0.00% <ø> (ø)
...java/io/seata/server/metrics/MetricsPublisher.java 93.75% <ø> (ø)
...src/main/java/io/seata/rm/tcc/TCCFenceHandler.java 0.00% <0.00%> (ø)
... and 23 more

@robynron robynron changed the title [WIP] Metrics collected on the Seata client side support for observing metrics collected on seata client side Aug 29, 2022
@slievrly slievrly added the summer2022 summer code 2022 label Sep 7, 2022
@wangliang181230 wangliang181230 changed the base branch from develop to summer-code-2022 September 19, 2022 01:58
@wangliang181230 wangliang181230 changed the base branch from summer-code-2022 to develop September 19, 2022 02:07
@wangliang181230 wangliang181230 added this to the Summer Code 2022 milestone Nov 30, 2022
@CLAassistant
Copy link

CLAassistant commented Dec 12, 2022

CLA assistant check
All committers have signed the CLA.

@Bughue
Copy link
Contributor

Bughue commented May 16, 2023

@funky-eyes
Copy link
Contributor

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.
由于代码冲突以及年代久远,如果你还有兴趣参与到社区,请解决完冲突后重新请提交这份pr至2.x分支中

@funky-eyes funky-eyes closed this Nov 28, 2023
@robynron
Copy link
Contributor Author

好的,我后面基于2.x分支重新弄一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
summer2022 summer code 2022
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metrics statistics of Seata Client SDK
8 participants