Skip to content

add MicroBenchMark model#2851

Merged
davidzollo merged 15 commits intoapache:devfrom
CalvinKirs:jmh
Jun 6, 2020
Merged

add MicroBenchMark model#2851
davidzollo merged 15 commits intoapache:devfrom
CalvinKirs:jmh

Conversation

@CalvinKirs
Copy link
Copy Markdown
Member

Tips

What is the purpose of the pull request

add jmh model,we can have better data support for code optimization or code performance. Later, we can also expand on this basis to facilitate users to do performance tests.

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

Do I need to write a test case?

This change added tests and can be verified as follows:

-- Manually verified the change by testing locally

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 31, 2020

Codecov Report

Merging #2851 into dev will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev    #2851      +/-   ##
============================================
- Coverage     37.19%   37.15%   -0.04%     
+ Complexity     2559     2556       -3     
============================================
  Files           435      435              
  Lines         20020    20020              
  Branches       2426     2426              
============================================
- Hits           7447     7439       -8     
- Misses        11907    11912       +5     
- Partials        666      669       +3     
Impacted Files Coverage Δ Complexity Δ
...he/dolphinscheduler/common/thread/ThreadUtils.java 68.25% <0.00%> (-6.35%) 13.00% <0.00%> (-1.00%)
...e/dolphinscheduler/remote/NettyRemotingClient.java 51.07% <0.00%> (-2.88%) 9.00% <0.00%> (-2.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12c249a...091b066. Read the comment docs.

Copy link
Copy Markdown
Contributor

@davidzollo davidzollo left a comment

Choose a reason for hiding this comment

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

+1

good job,some tests need to be done

Copy link
Copy Markdown
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

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

It's not rational to run the micro-benchmark in the test, this would drastically slow down the CI builds, suggestion is excluding the micro-benchmark from the test phase

@CalvinKirs
Copy link
Copy Markdown
Member Author

It's not rational to run the micro-benchmark in the test, this would drastically slow down the CI builds, suggestion is excluding the micro-benchmark from the test phase

I have excluded it, please check

@kezhenxu94
Copy link
Copy Markdown
Member

It's not rational to run the micro-benchmark in the test, this would drastically slow down the CI builds, suggestion is excluding the micro-benchmark from the test phase

I have excluded it, please check

You just exclude the sonar check

@CalvinKirs
Copy link
Copy Markdown
Member Author

It's not rational to run the micro-benchmark in the test, this would drastically slow down the CI builds, suggestion is excluding the micro-benchmark from the test phase

Sorry, I don’t quite understand what you mean, because it does not contain the test module itself, can you please elaborate

Comment on lines +80 to +88
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why we need to shade these classes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why we need to shade these classes?

I think microbench can be used as a runnable package, do you have any good suggestions?

Copy link
Copy Markdown
Member

@kezhenxu94 kezhenxu94 Jun 2, 2020

Choose a reason for hiding this comment

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

Why we need to shade these classes?

I think microbench can be used as a runnable package, do you have any good suggestions?

Interesting :) In my opinion, shading classes is to avoid version/naming conflicts between a library and the user's dependencies, but for micro-benchmark tests, we only have one version and the users don't interact with this module, am I right?

JMH can be packaged into a uber jar and executable indeed, but the classes are all known to us, there is no class that will conflict with the existed ones, so no shading is necessary, right? If I'm wrong, please correct me 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why we need to shade these classes?

I think microbench can be used as a runnable package, do you have any good suggestions?

Interesting :) In my opinion, shading classes is to avoid version/naming conflicts between a library and the user's dependencies, but for micro-benchmark tests, we only have one version and the users don't interact with this module, am I right?

JMH can be packaged into a uber jar and executable indeed, but the classes are all known to us, there is no class that will conflict with the existed ones, so no shading is necessary, right? If I'm wrong, please correct me 😄

My original intention is to use it as a data reference for the optimization of our code performance. In addition, I hope that after the performance improvement, users of dolphinscheduler can use this to verify.So i do this, What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good to me

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why we need to shade these classes?

I think microbench can be used as a runnable package, do you have any good suggestions?

Interesting :) In my opinion, shading classes is to avoid version/naming conflicts between a library and the user's dependencies, but for micro-benchmark tests, we only have one version and the users don't interact with this module, am I right?

JMH can be packaged into a uber jar and executable indeed, but the classes are all known to us, there is no class that will conflict with the existed ones, so no shading is necessary, right? If I'm wrong, please correct me 😄

Thank you for your suggestion, I have completed the change, please review it

@kezhenxu94
Copy link
Copy Markdown
Member

It's not rational to run the micro-benchmark in the test, this would drastically slow down the CI builds, suggestion is excluding the micro-benchmark from the test phase

Sorry, I don’t quite understand what you mean, because it does not contain the test module itself, can you please elaborate

Sorry I missed that, please ignore me

@davidzollo
Copy link
Copy Markdown
Contributor

is there a document about how to use it ?

@CalvinKirs
Copy link
Copy Markdown
Member Author

is there a document about how to use it ?

Sorry, I will add related documents on the website later

@kezhenxu94
Copy link
Copy Markdown
Member

Look good to me once the related doc is added :)

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Jun 5, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

warning The version of Java (1.8.0_252) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11.
Read more here

@davidzollo
Copy link
Copy Markdown
Contributor

the how to use doc : apache/dolphinscheduler-website#125

@davidzollo davidzollo merged commit b21259d into apache:dev Jun 6, 2020
@davidzollo
Copy link
Copy Markdown
Contributor

good job, looking forward for next contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants