-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Add fs iotime in Nodes Stats API #67861
Conversation
Pinging @elastic/es-core-features (Team:Core/Features) |
@elasticmachine update branch |
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.
Thanks for working on this @easyice. LGTM
@elasticmachine ok to test |
@elasticmachine update branch |
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.
@easyice I've just left a comment regarding adding backwards compatibility checks for this change. Thanks!
out.writeLong(currentIOTime); | ||
out.writeLong(previousIOTime); |
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.
We'll need to read/write the new fields in a backwards compatible way (similar to how we do it here for eg. https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/AggProvider.java#L137 - there are probably other areas in the code). Let me know if you need any help with these version checks to ensure these fields are added in a BWC way.
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.
Thanks for the detailed instructions, i added the compatibility checks ,use Version.V_7_13_0
currentIOTime = in.readLong(); | ||
previousIOTime = in.readLong(); |
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.
Version checks for bwc are needed here as well
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.
Thanks for review, Version checks is added
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.
Thanks for iterating on this @easyice
Apologies, I should've mentioned, at the time of merge we need the version checks to be against V8_0_0
(and I'll subsequently change them to 7_13_0
after the change is backported to that release line). Can you please modify the version checks?
Also, there are some checkstyles issues. We have more information on how to configure and run the checkstyle locally here - alternatively, running something along the lines of ./gradlew checkStyleMain checkStyleTest checkstyleInternalClusterTest checkstyleIntegTest checkstyleTestFixtures
should help spot the issues
Thanks for @andreidan , I will pay more attention next time |
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.
Thanks for fixing the version and the checkstyle
Added just a few more minor comments, this is close to complete.
Besides the comments there's also a test failure in org.elasticsearch.xpack.monitoring.collector.node.NodeStatsMonitoringDocTests.testToXContent
|
||
final DeviceStats[] devicesStats; | ||
final long totalOperations; | ||
final long totalReadOperations; | ||
final long totalWriteOperations; | ||
final long totalReadKilobytes; | ||
final long totalWriteKilobytes; | ||
long totalIOTimeInMillis; |
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.
can we make this final please? (explicitly initialising it to 0 on the else
branch after the constructor version check here )
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.
thanks you @andreidan, i will make it as final
long currentIOTime; | ||
long previousIOTime; |
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.
Can we also mark these as final
?
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.
Okay, I've changed it to final, thank you for check!
Thanks for @andreidan Lines 277 to 283 in f0aa1b1
and NodeStatsMonitoringDoc#XCONTENT_FILTERS Lines 115 to 120 in f0aa1b1
Do these also need to be add the |
💚 CLA has been signed |
I'm sorry i use another computer push some code, which git config is not match this user and email, cause the cla check error, when I change to the correct configuration, the cla check still returns an error, can you please help me how to fix this issue? @andreidan |
…make some variable as final
@andreidan the CLA check failed issue is fixed, Can you please take review again? Thanks! |
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.
Sorry for the late reply @easyice (I was on holiday). Thanks for addressing the previous comments and for iterating on this! I think this is close to complete, I've left just a couple of super minor formatting comments after which this is complete
} | ||
else{ | ||
this.totalIOTimeInMillis = 0; |
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.
super minor: there's a formatting issue here
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { | ||
currentIOTime = in.readLong(); | ||
previousIOTime = in.readLong(); | ||
}else { |
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.
super minor: there's a formatting issue here
@elasticmachine update branch |
Thanks for @andreidan , happy holiday! the formatting issue is fixed |
@elasticmachine update branch |
Disable bwc in preparation for merging #67861
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.
Thanks for your contribution and for iterating on this @easyice
LGTM
This adds io_time_in_millis to Nodes stats API (cherry picked from commit 71a9cfe) Signed-off-by: Andrei Dan <[email protected]>
This adds io_time_in_millis to Nodes stats API (cherry picked from commit 71a9cfe) Signed-off-by: Andrei Dan <[email protected]> Co-authored-by: zhangchao <[email protected]>
Thanks for your help @andreidan |
Seems to be missing from elastic#67861 .
Related to #67805
This PR add io_time_in_millis in Nodes stats API, In the benchmark, it works almost as well as the iostat command
step 1,Perform random reads and writes on disk
step 2, Compare the results of the io_time and iostat commands,use this script
the result: