-
Notifications
You must be signed in to change notification settings - Fork 533
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
[INLONG][feature][audit] audit-sdk module #1929
Conversation
add inlong audit adk
edit pom info
code formatting
add License to the Apache Software Foundation (ASF)
add License to the Apache Software Foundation (ASF)
Use checkstyle standard code
Codecov Report
@@ Coverage Diff @@
## master #1929 +/- ##
============================================
- Coverage 12.26% 12.26% -0.01%
- Complexity 1155 1157 +2
============================================
Files 413 413
Lines 35225 35225
Branches 5542 5542
============================================
- Hits 4322 4320 -2
Misses 30133 30133
- Partials 770 772 +2
Continue to review full report at Codecov.
|
inlong-audit/audit-sdk/README.md
Outdated
The audit sdk is used to count the receiving and sending volume of each module in real time according to the cycle, | ||
and the statistical results are sent to the audit access layer according to the cycle. | ||
|
||
##features |
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.
Add a space before features
.
<dependency> | ||
<groupId>org.apache.inlong</groupId> | ||
<artifactId>audit-common</artifactId> | ||
<version>0.12.0-incubating-SNAPSHOT</version> |
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.
use ${project.version}
.
@@ -38,6 +38,7 @@ | |||
<module>audit-docker</module> | |||
<module>audit-store</module> | |||
<module>audit-common</module> | |||
<module>audit-sdk</module> |
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.
more spaces should be moved before <module>
.
The audit sdk uses log production time as the audit standard, | ||
which can ensure that each module is reconciled in accordance with the unified audit standard. | ||
|
||
## usage |
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.
here we can add more guides about how to use this SDK.
dockerId = dockerID2.substring(n + 1, 12); | ||
} | ||
} catch (IOException e) { | ||
System.out.println(e.getMessage()); |
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.
do not print exceptions to the console.
} catch (Exception e3) { | ||
System.out.println(e3.getMessage()); | ||
return; | ||
} finally { |
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.
It's recommended to use try-with-resource instead of try-finally.
future = client.connect(ipPortObj.addr).await(); | ||
senderChannel = new SenderChannel(future.getChannel(), ipPortObj, 10); | ||
} catch (InterruptedException e) { | ||
System.out.println(e.getMessage()); |
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.
ditto
public void getChannel() { | ||
Channel channel = senderChannel.getChannel(); | ||
System.out.println(channel.getConfig().getConnectTimeoutMillis()); | ||
System.out.println(channel.getRemoteAddress()); |
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.
use assert instead of print to the console.
|
||
sender.setHasSendError(true); | ||
isError = sender.isHasSendError(); | ||
System.out.println(isError); |
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.
ditto
Standardize unit testing and log printing
update README
add audit-sdk module
Fixes #1734